I can create a .pth file and put it in my virtualenv lib\site-packages to bring the MySQLdb that is installed by the windows installer into my virtualenv. But so far the only way I have been able to get this to work is if I use this path in the .pth file:
C:\python27\lib\site-packages
This of course now brings in the ENTIRE lib\site-packages into the virtualenv.
How do I add ONLY MySQLdb to the virtual environment?
Yes, it’s on Windows. No, I can’t switch to a real OS for this so I could use add2virtualenv from virtualenvwrapper.
After way too much wasted time I’ve become convinced it is too hard to get mysqldb into a virtualenv with symbolic links on windows. However it is possible to fix it like so:
And tell it that this is a directory (not a file)
And tell it that this is a directory (not a file)
copy c:\python27\lib\site-packages_mysql*.* c:\Python\VirtualENV\lib\site-packages
You may at some point have to deal with 1.2.3 being something else, and of course VirtualENV is the virtualENV you need the support in.
You can get the mysql stuff from this link.
http://www.codegood.com/archives/129
Part of the problem comes from the fact that not all the mysql files are in the mysql directories. If they were, then a couple of symbolic links would work, but they aren’t and it isn’t worth fixing for windows.