GAE - Python3 - Flask - Talisman suddenly throws error module six not found

233 views
Skip to first unread message

Karl-Heinz Müller

unread,
Aug 14, 2020, 12:16:18 PM8/14/20
to Google App Engine
Hi, while updating the application today, I noticed that flask-talisman throws an error. 

 File "/env/lib/python3.7/site-packages/flask_talisman/talisman.py", line 17, in <module> from six import iteritems, string_types ModuleNotFoundError: No module named 'six'

I use the same versions for flask and flask_talisman version as before and set in requirements.txt

Flask==1.0.2
flask-talisman==0.7.0

I tried to fix the error by adding six to the requirements. This didn't resolve the issue. Wondering why continue using the same modules, this error suddenly appears and which combinations of modules allow me to continue using flask-talisman.

For now I temporarily commented out the talisman. 

Is it a temporal glitch/bug? What can I do to run flask-talisman on GAE/Python3.7?
Please let me know what additional information you need to know.

Thanks

Karl-Heinz Müller

unread,
Aug 14, 2020, 12:29:48 PM8/14/20
to Google App Engine
Adding six==1.9.0 resolves the issue.

The content of the modified requirements.txt:
Flask==1.0.2
six==1.9.0 
flask-talisman==0.7.0

Maybe my post will help someone else stumbling over the same issue. Curious, why this can happen while using the same versions of the different modules. Some modules have changed and which loaded which I don't explicitly mention in requirements.txt

Mary (Google Cloud Support)

unread,
Aug 18, 2020, 8:11:29 PM8/18/20
to Google App Engine
Hello Karl,

In the GAE Python 2.7 runtime, six was part of the 3rd party libraries which was bundled as part of the runtime[1]. With Python 3.7, some of these libraries were not included in the runtime in order to provide a more idiomatic python environment and need to be migrated[2] by specifying these previously bundled libraries into the requirements.txt


Karl-Heinz Müller

unread,
Aug 19, 2020, 8:05:01 AM8/19/20
to Google App Engine
Thanks Mary for following up.

I am aware of the differences from 2.7 to 3.7. It's not that I migrated the application to 3.7. Previously the application (written in 3.7) didn't require explicit declaration of module "six" in requirements.txt and suddenly it is required. I have no explanation for such a change other than a modification under the hood by updating one of the used libraries, or dependency of libraries, without version modification.

The possibility that a library has been updated without version change is the issue which is worrying me. I had similar issues in the past while running python 2.7 applications but there we used the non-recommended statement to use the latest library. We changed and indicate now the version of a library we want to use and which has been tested.

Thanks
Karl-Heinz

Mohammad I (Cloud Platform Support)

unread,
Aug 20, 2020, 11:27:06 PM8/20/20
to Google App Engine

Hello Karl, 


Thank you for your message. The App Engine Engineering team will take a note of it. 


If you consider the issue that you have encountered is technical in nature, I would recommend you to create an App Engine Public Issue under the “Compute” section by going here as the issue may be required to refer to the App Engine Engineering team. 


Please select the private component as probably you will have to share project specific information, so that it is not visible to the public. One of the Google Cloud Platform Support Agents will assist you to resolve your issue.


Please note that Google Groups is only meant for general discussion related to Google Cloud Platform products which are not technical in nature, service status updates and release notes, and ranging from book recommendations to creative shortcuts.

Reply all
Reply to author
Forward
0 new messages