This is my first time using virtualenv and MySQLdb and I'm getting a strange error. After I setup this virtualenv, I installed MySQLdb from within the virtualenv (with the ENV actually activated). MySQLdb is not installed globally. When I'm in my ENV folder, open a python terminal, and try to import the module I get the following:
import MySQLdb Traceback (most recent call last): File "", line 1, in ImportError: No module named MySQLdb
However, when I do the same thing from the site-packages folder
everything seems to work just fine.
Also, when I run
from either directory, I get very slightly different lists (even though it's telling me I'm using the same python executable). It's like for some reason the same python executable is getting it's modules from different places and the only time it's getting the modules it's supposed to have is deep inside the ENV, in this case the site-packages folder. If I'm not in the site-packages folder, it seems to get a different list and I get no access to MySQLdb.
I'm using Mac OSX Mavericks, XCode is up to date to the best of my knowledge (I don't find I use it very much).
I used this to setup the virtualenv
virtualenv -p /usr/local/Cellar/python/2.7.8/bin/python ENV
which python gives me this both in ENV and in site-packages
virtualenv version 1.11.6 python 2.7.8 (not the default python)
(ENV)tims-mbp:ENV timbauer$ pip install sqlalchemy
And am getting the exact same affect. It seems like even though it's using the correct python when inside ENV, that version of python only is getting the correct module list when it's directly inside the site-packages folder. Otherwise it looks like it's pulling from the global list</div