fbpx
  • Home
  • >>
  • Blog
  • >>
  • Tech
  • >>
  • FIXED importerror: cannot import name ‘json’ from ‘itsdangerous’
Sharing Is Caring!

You have landed on this post because you facing or have faced this “importerror: cannot import name ‘json’ from ‘itsdangerous’“. The cause of this error is a result of incompatibility of flask and itsdangerous package versions.

Now you may ask what is itsdangerous package and what is it used for. Itsdangerous package is a python package that allows helpers to pass data to untrusted sources without it being tempered and returns the data safe and sound.

Method 1: Upgrading Flask

Since this problem is mostly caused by your current Flask version not being compatible with the itsdangerous package version. Our first recommended solution is to upgrade Flask to the latest version by using the command below.

pip install flask

You may face importerror: cannot import name ‘soft_unicode’ from ‘markupsafe’. If that happens update MarkupSafe to its recent version by using the command below.

pip install markupsafe

If the problem still exists then let’s move to the next method.

Method 2: Downgrading itsdangerous Package

Flask 1.1.2 package is set up in a way that requires or compatible itsdangerous versions 0.24 and above.

So if you are having Flask 1.1.2, then you may try downgrading your itsdangerous version to 2.0.1, not 2.10. To install Flask 1.1.2 and itsdangerous to 2.0.1, use the commands below

pip install flask==1.1.2
pip install itsdangerous==2.0.1

Best Compatibility options

If you have tried all of the above but still the problem still exists, then I will suggest the following alternatives.

  1. Upgrade all packages to the latest versions: You can also try upgrading all the three packages; flask, itsdangerous, and markupsafe to their latest version. Use the commands below.
pip install flask
pip install itsdannnngerous
pip install markupsafe
  1. Alternative 2: You can also maintain these packages versions which worked for most people. Flask at version 1.1.4 and itsdangerous at version 2.0.1. Use the commands below.
pip install flask=1.1.4
pip install itsdangerous=1.1.0

Conclusion

Now, you have known how to solve importerror: cannot import name ‘json’ from ‘itsdangerous’, if you still have a challenge, you can use the comment box to tell us which method worked for you.

Overall Ratings
Click to rate this post!
[Total: 0 Average: 0]

Sharing Is Caring!
Leave a Reply
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Latest Articles

StreetWayz

Sharing Is Caring! This post you guide you on how to program

StreetWayz

Sharing Is Caring! If you are searching for how to delete Five

StreetWayz

Sharing Is Caring! The internet has become a necessary component of our

StreetWayz

Sharing Is Caring! Menulog has been one of the most popular food-based

StreetWayz

Sharing Is Caring! This post will look at how to set up

StreetWayz

Sharing Is Caring! In this article, we will look at how to

Free Download

Guide: How to Get [Benefit] Without [Pain Point]

How to Get (benefit) Without (pain point)