Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: ModuleNotFoundError: No module named 'jsonschema.compat' #843

Closed
peterdudfield opened this issue Sep 30, 2021 · 6 comments
Closed

Bug: ModuleNotFoundError: No module named 'jsonschema.compat' #843

peterdudfield opened this issue Sep 30, 2021 · 6 comments

Comments

@peterdudfield
Copy link

peterdudfield commented Sep 30, 2021

I'm currently getting the error - ModuleNotFoundError: No module named 'jsonschema.compat'
I think this first started today

I get this on python 3.9.7, when running import neptune

This could be an error with 'swagger_spec_validator'

See error here

For reference I have also created a big report here: Yelp/swagger_spec_validator#149

@meanderingsquirreleatsnuts

Getting the same error too, it started 9hrs ago

import python_jsonschema_objects as jso
/home/builder/.local/lib/python3.6/site-packages/python_jsonschema_objects/init.py:12: in
from jsonschema.compat import iteritems
E ModuleNotFoundError: No module named 'jsonschema.compat'

@peterdudfield
Copy link
Author

Screenshot 2021-09-30 at 09 39 12

Seems to be a move away from iteritems, to '.items()' instead

@svart-riddare
Copy link

I do not know if this is related or not to python-openapi/openapi-spec-validator#130, another openapi validator that stopped working when upgrading to jsonschema 4.0.0.

@peterdudfield
Copy link
Author

I've created a PR that added compact.py back in with a warning

@peterdudfield
Copy link
Author

I do not know if this is related or not to p1c2u/openapi-spec-validator#130, another openapi validator that stopped working when upgrading to jsonschema 4.0.0.

This looks a different issue, but also related to the release of 4.0.0

@Julian
Copy link
Member

Julian commented Sep 30, 2021

Hi all.

jsonschema.compat was documented both in its docstring as well as in a note in the documentation as being private. It was also never documented to end-users (i.e. other than that note, no list of what's in there appeared anywhere). The reason it existed at all was simply because jsonschema is going on 9 years now and existed before something like six was usable, otherwise jsonschema would have used six and not its own compat module -- but jsonschema.compat definitely was not intended (or promised to be usable) by any other users than jsonschema itself.

So it's unfortunate some downstream packages used things from it anyhow, but it's not covered by the deprecation policy. These packages should remove their use of it and use six or an equivalent if they're still supporting versions where it's needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants