Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named flask

I installed virtualenv, activated it, and installed flask. So I have three folders: Include, Scripts and Lib. This last folder contains the site-packages folder, that contains flask folder.

If I put my app.py (simple Hello World app) inside "site-packages" folder, I don't get this error. But if put out of this three folder, but inside my flask_environment, I get this error.

Is something going wrong here?

The error:

Traceback (most recent call last):
  File "C:\Flask\flask_env\app.py", line 3, in <module>
    from flask import Flask
ImportError: No module named flask
like image 682
imtk Avatar asked Jun 12 '14 15:06

imtk


Video Answer


1 Answers

Please make sure you have activated virtual environment before running python file.

. venv/bin/activate
like image 51
Dhananjay Avatar answered Sep 22 '22 17:09

Dhananjay