【问题标题】:My jupyter notebook doesn't execute code anymore我的 jupyter notebook 不再执行代码
【发布时间】:2020-05-20 15:15:36
【问题描述】:

我今天尝试安装pip install google-colab,但由于某种原因失败了。从那以后,再也没有任何效果了。当我在 Python 3 内核上运行代码时,它永远不会被执行(重新启动内核没有帮助)。当我在我的 venv 内核上运行它时,我可以执行不需要任何模块的代码,例如 print("hi")。但是当我导入模块时,出现以下错误:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/opt/anaconda3/envs/torch/lib/python3.8/codeop.py in __call__(self, source, filename, symbol)
    134 
    135     def __call__(self, source, filename, symbol):
--> 136         codeob = compile(source, filename, symbol, self.flags, 1)
    137         for feature in _features:
    138             if codeob.co_flags & feature.compiler_flag:

TypeError: required field "type_ignores" missing from Module

感谢任何帮助!

【问题讨论】:

    标签: jupyter-notebook anaconda python-3.8


    【解决方案1】:

    安装 google.colab -> 删除虚拟环境然后再次创建虚拟环境后,我在虚拟环境中遇到了同样的问题。以下解决了这个问题:

    pip3 uninstall notebook
    pip3 install --ignore-installed --no-cache-dir --upgrade notebook
    

    【讨论】:

      猜你喜欢
      • 2021-11-30
      • 2018-08-31
      • 1970-01-01
      • 1970-01-01
      • 2023-01-10
      • 2020-12-01
      • 1970-01-01
      • 2017-11-26
      • 1970-01-01
      相关资源
      最近更新 更多