Unable to use Jupyter Notebook: jsonschema is obviously missing

When using the Anaconda environment, I cannot start Jupyter to work in a laptop. I can do this without the environment, but I need to be able to use the environment. Here is what I do and I get errors:

ben@ben-K60IJ :~/surveillance_sound_classifier/surveillance_sound_classifier$ source activate EECS352 discarding /home/ben/anaconda/bin from PATH prepending /home/ben/anaconda/envs/EECS352/bin to PATH (EECS352) ben@ben-K60IJ :~/surveillance_sound_classifier/surveillance_sound_classifier$ jupyter notebook Traceback (most recent call last): File "/home/ben/anaconda/envs/EECS352/bin/jupyter-notebook", line 4, in <module> import notebook.notebookapp File "/home/ben/anaconda/envs/EECS352/lib/python2.7/site-packages/notebook/notebookapp.py", line 61, in <module> from .services.contents.manager import ContentsManager File "/home/ben/anaconda/envs/EECS352/lib/python2.7/site-packages/notebook/services/contents/manager.py", line 16, in <module> from nbformat import sign, validate, ValidationError File "/home/ben/anaconda/envs/EECS352/lib/python2.7/site-packages/nbformat/__init__.py", line 33, in <module> from .validator import validate, ValidationError File "/home/ben/anaconda/envs/EECS352/lib/python2.7/site-packages/nbformat/validator.py", line 21, in <module> raise ImportError(str(e) + verbose_msg) ImportError: No module named functools32 Jupyter notebook format depends on the jsonschema package: https://pypi.python.org/pypi/jsonschema Please install it first. 

Yes, I did pip install jsonschema and conda install jsonschema AND pip install functools32 and conda install functools32 from inside the EECS352 environment to no avail; I get an almost identical error, except for this time, functools32 is replaced with _version .

I reinstalled Anaconda, updated all its packages, created a new environment in the same way as I created this, and still get this error. I am using 32 bit Ubuntu 15.10. I used to use this environment without problems until about a week ago.

If this is a duplicate, indicate me the original; however, I have not yet found anything that is really relevant. The only thing that may be appropriate is that this error occurred after I modified some .conf file because I was having problems updating my software using sudo apt-get upgrade . I don’t remember what I did, and to which file, but if this is probably the source of this problem, I can spend some time trying to track it. Please let me know if I take my time to do this, and I will.

+6
source share
5 answers

I think I have a solution.

I did something, updated my env (anaconda env) from another computer, where it worked, but failed.

What I think I nailed it is updating jsonschema to 2.5.1

Here are my steps from the bad jupyter env to jupyter env.

Good luck and come back, if this does not work, I will send the appropriate version of the laptop.

 >conda upgrade pip pip: 8.1.0-py27_0 --> 8.1.1-py27_0 setuptools: 20.2.2-py27_0 --> 20.3-py27_0 >pip install functools32 Downloading functools32-3.2.3-2.tar.gz Successfully installed functools32-3.2.3.post2 >jupyter notebook ImportError: No module named _version Jupyter notebook format depends on the jsonschema package: https://pypi.python.org/pypi/jsonschema Please install it first. >pip install jsonschema Requirement already satisfied >pip install --upgrade jsonschema Collecting jsonschema Downloading jsonschema-2.5.1-py2.py3-none-any.whl Successfully uninstalled jsonschema-2.4.0 Successfully installed jsonschema-2.5.1 >jupyter notebook [I 16:45:41.708 NotebookApp] Writing notebook server cookie secret to [I 16:45:42.134 NotebookApp] Serving notebooks from local directory: [I 16:45:42.134 NotebookApp] 0 active kernels [I 16:45:42.134 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/ 
+19
source

I had the same problem.

I solved this by running this command

 conda install -c anaconda jsonschema 

https://anaconda.org/anaconda/jsonschema

+1
source

Try this from the terminal:

 pip install ipython[notebook] 

This worked for me, let me know if the problem still exists.

0
source

I also found this problem when using conda virtual environments. The workaround I found is to switch from python 3.6 to python 3.5 with:

(env) / location / of / my / code: conda install python \ <3.6

0
source

Try this from the terminal, it worked for me:

 pip install --upgrade pyrsistent 
0
source

Source: https://habr.com/ru/post/1244771/


All Articles