On Tue, Jun 10, 2008 at 6:12 AM, King Simon-NFHD78
<[EMAIL PROTECTED]> wrote:
>
> Lukasz Szybalski wrote:
>>
>>
>> I have mysqldb installed in the system wide install how do I tell
>> virtualenv to use it?
>> I don't see a need to install it in virtualenv again so I guess I just
>> have to givea right path? How, and in which file?
>>
>> Thanks,
>> Lucas
>>
>>
>>  File
>> "/usr/local/pythonenv/BASELINE/lib/python2.4/site-packages/SQL
> Alchemy-0.4.6dev_r4675-py2.4.egg/sqlalchemy/databases/mysql.py",
>> line 1430, in dbapi
>>     import MySQLdb as mysql
>> ImportError: No module named MySQLdb
>>
>
> When you create the virtualenv, there is a '--no-site-packages' switch
> which determines whether the system-wide site-packages directory will be
> on the search path or not. If you didn't provide this switch, then
> MySQLdb should be visible. (Documented at
> http://pypi.python.org/pypi/virtualenv#the-no-site-packages-option)
>
> From your python prompt, type "import sys; print '\n'.join(sys.path)"

Your command actually doesn't show the virtualenv? Is that how it
suppossed to be?
:~$ source /usr/local/pythonenv/BASELINE/bin/activate
(BASELINE)[EMAIL PROTECTED]:~$ python
Python 2.4.4 (#2, Apr  5 2007, 20:11:18)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys; print '\n'.join(sys.path)

/usr/lib/python2.4/site-packages/Dabo-0.8.3-py2.4.egg
/usr/lib/python2.4/site-packages/pyodbc-0.0.0-py2.4-linux-i686.egg
/usr/lib/python2.4/site-packages/Sphinx-0.1.61950-py2.4.egg
/usr/lib/python2.4/site-packages/Pygments-0.9-py2.4.egg
/usr/lib/python24.zip
/usr/lib/python2.4
/usr/lib/python2.4/plat-linux2
/usr/lib/python2.4/lib-tk
/usr/lib/python2.4/lib-dynload
/usr/local/lib/python2.4/site-packages
/usr/lib/python2.4/site-packages
/usr/lib/python2.4/site-packages/Numeric
/usr/lib/python2.4/site-packages/cairo
/var/lib/python-support/python2.4
/usr/lib/python2.4/site-packages/gtk-2.0
/var/lib/python-support/python2.4/gtk-2.0
/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode



What I did is I regenerated the virtual env without the
no-site-package part, (leaving everything the way it was, just
rerunning the command) which added the system packages. I hope now
when I do easy_install -U somesystempackage it will install the
upgrade into the virtualenv location.

Lucas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to