1

I moved my project directory to a new location. Now, when I try and run my application locally, I receive an "ImportError: No module named flask"

Here is my work flow:

$ mv my_project/ ~/new_dir/
$ cd ~/new_dir/my_project
$ source venv/bin/activate
(venv)$ python my_app
Traceback (most recent call last):
  File "my_app.py", line 1, in <module>
    from flask import Flask, request
ImportError: No module named flask

I realize this is a PATH issue, but I want to understand why it happens and how to fix it. I'm more interested in an explanation than a quick solution.

Flask is still in my venv/lib/Python2.7/site-packages/ directory, but clearly Python is not finding it. I never explicitly added the previous location of site-packages to the PATH, so I'm assuming pip and/or venv did some behind the scenes magic for me. What's going on?

Thanks!

Matt Parrilla
  • 2,901
  • 4
  • 30
  • 50
  • 3
    answer is here http://stackoverflow.com/questions/6628476/renaming-a-virtualenv-folder-without-breaking-it – Tigra May 02 '13 at 14:49

0 Answers0