jsonschema 3.2.0 and perhaps any version less than 4.0 support Python 2.7. Try
pip install "jsonschema<4.0"
Answer from phd on Stack Overflow
» pip install jsonschema
I think I have a solution.
I did may things, regenerated my env (anaconda env) from another computer where it worked, but no success.
What I think that nailed it is upgrading jsonschema to 2.5.1
Here are my steps from "bad" jupyter env to working jupyter env.
Good luck and come back if it doesn't work, I will post the notebook* relevant versions.
>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/
i also got the same error and none of the above mentioned procedures worked for me so i've checked the documentation of anaconda and found something useful
conda install -c conda-forge/label/cf201901 jsonschema
conda install jupyter
jupyter notebook
this worked for me,thanks to anaconda documentation
» pip install jsonschema-specifications
Sorry if my questions are basic. I don't do this (python programming) on a regular basis. Only running these commands according to a README of some repository I had to set up.
My python commands are running in two circles:
-
it says I need to upgrade to 24.0. I run upgrade, and it shows I'm there. Then it says I need to upgrade again.
-
It says I'm missing jsonschema module. I installed it, reinstall only says "equirement already satisfied". But then my program still says I'm missing the module.
How do I get out of this trap? Please help!
(mypenv) myuser-mac:myprogram myuser$ ./myproduct_generator.py --fleets-dir inventory_requests/fleets -rd inventory_requests/regions -od ~/temp/finished_myproducts Traceback (most recent call last): File "/Users/myuser/Workplace/WORKDIR/repos/bootstrap-footprint/myprogram/./myproduct_generator.py", line 17, in <module> import jsonschema ModuleNotFoundError: No module named 'jsonschema' (mypenv) myuser-mac:myprogram myuser$ pip install jsonschema Requirement already satisfied: jsonschema in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (4.22.0) Requirement already satisfied: attrs>=22.2.0 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from jsonschema) (23.2.0) Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from jsonschema) (2023.12.1) Requirement already satisfied: rpds-py>=0.7.1 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from jsonschema) (0.18.1) Requirement already satisfied: referencing>=0.28.4 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from jsonschema) (0.35.1) [notice] A new release of pip available: 22.2 -> 24.0 [notice] To update, run: python3.9 -m pip install --upgrade pip (mypenv) myuser-mac:myprogram myuser$ pip3 -V pip 24.0 from /Users/myuser/python-envs/mypenv/lib/python3.9/site-packages/pip (python 3.9) (mypenv) myuser-mac:myprogram myuser$ python3.9 -m pip install --upgrade pip Requirement already satisfied: pip in /Users/myuser/python-envs/mypenv/lib/python3.9/site-packages (24.0) #If I run above commands again, it's basically a repeat.
» pip install jsonschema-rs