close

[Fixed] ImportError: cannot import name ‘json’ from ‘itsdangerous’

Today We are Going To Solve ImportError: cannot import name ‘json’ from ‘itsdangerous’ in Flask. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

How to Fix ImportError: cannot import name ‘json’ from ‘itsdangerous’ Error?

  1. How to Fix ImportError: cannot import name ‘json’ from ‘itsdangerous’ Error?

    To Fix ImportError: cannot import name ‘json’ from ‘itsdangerous’ Error just Add the package dependency. lve this error very easily. Here you have to first of all add the package dependency itsdangerous==2.0.1 in your requirements.txt file. And then just update your virtual environment to reflect the new requirements.txt.

  2. ImportError: cannot import name ‘json’ from ‘itsdangerous’

    To Fix ImportError: cannot import name ‘json’ from ‘itsdangerous’ Error just Upgrade the Flask. To solve this error you have to just upgrade the Flask to latest version just like i given in below command. So just use this command: pip install Flask=2.0.1

Solution 1 : Add the package dependency

You can solve this error very easily. Here you have to first of all add the package dependency itsdangerous==2.0.1 in your requirements.txt file. And then just update your virtual environment to reflect the new requirements.txt.

Solution 2 : Upgrade the Flask

To solve this error you have to just upgrade the Flask to latest version just like i given in below command. So just use this command:

pip install Flask=2.0.1

Solution 3 : Downgrade the Flask

You have to downgrade Flask to 1.1.4 and by doing this youi can solve your error very easily. So try this command:

pip install flask==1.1.4

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read This Solutions

Leave a Comment