0

I am using python 3.8 on Windows 10 machine. I normally use VS Code and ipynb (without anaconda) inside it and everything was running smoothly A couple days ago, I started to het the following error:

    Traceback (most recent call last):
  File "c:\users\kshit\onedrive - university of waterloo\programming\python\installation\lib\site-packages\nbformat\validator.py", line 12, in <module>
    from jsonschema import ValidationError
  File "c:\users\kshit\onedrive - university of waterloo\programming\python\installation\lib\site-packages\jsonschema\__init__.py", line 34, in <module>
    __version__ = metadata.version("jsonschema")
  File "c:\users\kshit\onedrive - university of waterloo\programming\python\installation\lib\importlib\metadata.py", line 531, in version
    return distribution(distribution_name).version
  File "c:\users\kshit\onedrive - university of waterloo\programming\python\installation\lib\importlib\metadata.py", line 504, in distribution
    return Distribution.from_name(distribution_name)
  File "c:\users\kshit\onedrive - university of waterloo\programming\python\installation\lib\importlib\metadata.py", line 177, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: jsonschema

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\kshit\onedrive - university of waterloo\programming\python\installation\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\kshit\onedrive - university of waterloo\programming\python\installation\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\kshit\OneDrive - University of Waterloo\Programming\Python\Installation\Scripts\jupyter-notebook.EXE\__main__.py", line 5, in <module>
  File "c:\users\kshit\onedrive - university of waterloo\programming\python\installation\lib\site-packages\notebook\notebookapp.py", line 80, in <module>
    from .services.contents.manager import ContentsManager
  File "c:\users\kshit\onedrive - university of waterloo\programming\python\installation\lib\site-packages\notebook\services\contents\manager.py", line 17, in <module>
    from nbformat import sign, validate as validate_nb, ValidationError
  File "c:\users\kshit\onedrive - university of waterloo\programming\python\installation\lib\site-packages\nbformat\__init__.py", line 32, in <module>
    from .validator import validate, ValidationError
  File "c:\users\kshit\onedrive - university of waterloo\programming\python\installation\lib\site-packages\nbformat\validator.py", line 23, in <module>
    raise ImportError(str(e) + verbose_msg)
ImportError: jsonschema

    Jupyter notebook format depends on the jsonschema package:

        https://pypi.python.org/pypi/jsonschema

    Please install it first.

I tried to search for solutions on stackoverflow: Can't use Jupyter Notebook: jsonschema apparently missing

But none of the answers there worked for me.

I tried upgrading jsonschema, jupyter and pip itself several times but to no avail. Tried running it in Pycharm too, And I believe I have not changed anything in my python environment.

Any help is greatly appreciated.

Thanks, Kshitij.

1 Answers1

0

You shouldn't use pip install --upgrade pip to upgrade pip - it will throw some errors. You should do so from the website. A temporary solution to jupyter notebook is Google Colab - colab.research.withgoogle.com. It also uses .ipynb. Hope this helps!

Krishnan Shankar
  • 780
  • 9
  • 29