Home > other >  Python Flask import Error of module that isn´t being imported
Python Flask import Error of module that isn´t being imported

Time:02-19

I have a flask app running in Google App Engine. Yesterday I deployed a new version of my app where I only change the Html style. It deployed as it was supposed to. Today I realized that I didnt change the title for each corresponding html page, so I only changed the title tag in each html page. I depolyed the app again and now im getting this strange error of an Import Error for a module that I have never even used.... please help

Error

ImportError: cannot import name 'json' from 'itsdangerous' (/layers/google.python.pip/pip/lib/python3.7/site-packages/itsdangerous/__init__.py)

CodePudding user response:

This issue on Flask's GitHub is related.

Either update to Flask>2, or if that's not possible pin ItsDangerous<2 and MarkupSafe<2.

To pin to lower versions in a requirements.txt file:

flask==1.1.4
itsdangerous==1.1.0
markupsafe==1.1.1

CodePudding user response:

I had the same issue today. I was using flask=1.1.2, and when I updated the version to flask==2.0.3, the import issue was resolved.

CodePudding user response:

This is caused by changes in Flask dependencies. Another question about this was asked on ServerFault.

You can either upgrade to Flask>2, or I had to downgrade to itsdangerous==2.0.1 if you can't do that.

  • Related