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

ImportError: cannot import name 'json' from 'itsdangerous' #289

Closed
Donovant opened this issue Feb 18, 2022 · 5 comments
Closed

ImportError: cannot import name 'json' from 'itsdangerous' #289

Donovant opened this issue Feb 18, 2022 · 5 comments

Comments

@Donovant
Copy link

Donovant commented Feb 18, 2022

When trying to use Flask, which pulls Version 2.1.0, we're seeing the following error:

File "/usr/local/lib/python3.8/site-packages/flask/init.py", line 21, in
from .app import Flask, Request, Response
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 25, in
from . import cli, json
File "/usr/local/lib/python3.8/site-packages/flask/json/init.py", line 21, in
from itsdangerous import json as _json
ImportError: cannot import name 'json' from 'itsdangerous' (/usr/local/lib/python3.8/site-packages/itsdangerous/init.py)

The program should correctly import the json library if its needed (which I believe it is) or it should be removed.

Environment:

  • Python version: 3.8
  • ItsDangerous version: 2.1.0
  • Flask version: 1.0.2
@davidism
Copy link
Member

davidism commented Feb 18, 2022

You are using an unsupported version of Flask, please update to the latest version if possible. Additionally, please read https://hynek.me/articles/semver-will-not-save-you/, then use a tool like pip-tools to pin your dependencies and control when you get updates. Be sure to run your tests with deprecation warnings treated as errors so that you get notified of these types of changes early.

@Donovant
Copy link
Author

Just started looking into a more recent version of Flask. Thank you.

@LeanderLW

This comment was marked as off-topic.

@LeanderLW

This comment was marked as off-topic.

@pallets pallets locked as resolved and limited conversation to collaborators Feb 18, 2022
@pallets pallets unlocked this conversation Feb 18, 2022
@davidism davidism changed the title Version 2.1.0 cannot import name 'json' from 'itsdangerous' ImportError: cannot import name 'json' from 'itsdangerous' Feb 18, 2022
@davidism davidism pinned this issue Feb 18, 2022
@shaktis

This comment was marked as off-topic.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2022
@davidism davidism unpinned this issue Apr 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants