Reputation: 3264
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?
Upvotes: 5
Views: 13248
Reputation: 9600
I had installed quite a few flask packages only with pip
, but that was not enough, I also got the error ImportError: No module named werkzeug.exceptions
.
The hint of the other answer, mentioning python-flask
and python-werkzeug
, brought the main idea. In my case, the solution was to apt-get install python-flask
. It installed werkzeug as a dependency and the error was gone.
Upvotes: 0
Reputation: 1
I faced same issue. I got this error when working in python virtual environment. I had to deactivate virtual environment. Then go to root user and install werkzeug using pip. After that it works in virtual environment.
Upvotes: 0
Reputation: 777
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.
Upvotes: 1
Reputation: 300
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!
Upvotes: 1