Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name 'validate' from jsonschema

I'm quite new in python and faced this issue after the manual installation of the new jsonschema dependency.

$ python /var/www/html/graylog.py
Traceback (most recent call last):
  File "/var/www/html/graylog.py", line 18, in <module>
    from jsonschema import validate
ImportError: cannot import name 'validate'

Python version 3.6.8

This is the current pip list

Package            Version
------------------ --------
attrs              19.3.0
certifi            2019.3.9
chardet            3.0.4
Click              7.0
configparser       5.0.0
Flask              1.0.2
Flask-WTF          0.14.2
grapi              0.1.4
idna               2.8
importlib-metadata 1.6.1
itsdangerous       1.1.0
Jinja2             2.10
jsonschema         3.2.0
M2Crypto           0.35.2
MarkupSafe         1.1.1
Nuitka             0.6.8.3
pip                20.1.1
prometheus-client  0.8.0
PyMySQL            0.9.3
pyrsistent         0.16.0
PySimpleGUI        3.29.0
requests           2.21.0
setuptools         39.2.0
six                1.15.0
urllib3            1.24.1
virtualenv         16.4.3
Werkzeug           0.15.1
WTForms            2.2.1
zipp               3.1.0
like image 387
Polad Avatar asked Sep 02 '25 10:09

Polad


1 Answers

Try to update the jsonSchema version that often solves the error especially if it's been installed manually

pip install --upgrade jsonschema

It may also be that the python that you are using in your environment may point to a different version that does not contain the jsonSchema module. Try

python3 /var/www/html/graylog.py
like image 185
AzyCrw4282 Avatar answered Sep 06 '25 13:09

AzyCrw4282