My jupyter notebook doesn't execute code anymore

Viewed 729

I tried to install pip install google-colab today, which failed for some reason. Since then, nothing works anymore. When I run code on the Python 3 kernel, it just never gets executed (restarting kernel doesnt help). When I run it on my venv kernel, I can execute code, which doesn't require any modules, such as print("hi"). But when I import modules, I get the following error:

---------------------------------------------------------------------------
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

Any help is appreciated!

1 Answers

I had the same problem in a virtual environment after installing google.colab -> removing the virtual environment and then created the virtual environment again. The following solved that problem:

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