Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't import flask because werkzeug

When I use from flask import *, I get the error

ImportError: No module named werkzeug.exceptions

However, when I do pip freeze, I can see that Werkzeug==0.11.11 is indeed installed. How can I fix this?

like image 806
Everyone_Else Avatar asked Oct 29 '22 18:10

Everyone_Else


2 Answers

I am asumming, that the wrong version of Werkzeug was installed in the fist place. This usually happens, when you have 2 versions of python installed, and you use 'pip' for installing dependancies rather than using 'pip3'. Hope this helped!

like image 127
prathik shirolkar Avatar answered Nov 13 '22 03:11

prathik shirolkar


I had this problem with Yocto while installing python-flask from: http://git.yoctoproject.org/git/meta-virtualization.

The solution was to manually add python-werkzeug to my yocto image as well. I suspect that python-flask should depend upon python-werkzeug. Additionally, I had to add python-jinja2 as well to the image.

like image 22
Frederick Ollinger Avatar answered Nov 13 '22 02:11

Frederick Ollinger