I tried this http://jazstudios.blogspot.com/2010/07/installing-mysql-python-mysqldb-in.html tip to install mysql-python (mysqldb) inside a virtualenv (named dogme). (this post point out 2 important things :
export ARCHFLAGS="-arch x86_64"
echo "mysql_config = /opt/local/bin/mysql_config5" >> ./dogme/build/MySQL-python/site.cfg
to help compile mysqldb)
but, when after, i run python, import MySQLdb, I get this :
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/.virtualenvs/dogme/lib/python2.5/site-packages/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: dlopen(/home/.virtualenvs/dogme/lib/python2.5/site-packages/_mysql.so, 2): Symbol not found: _mysql_affected_rows
Referenced from: /home/.virtualenvs/dogme/lib/python2.5/site-packages/_mysql.so
Expected in: flat namespace
in /home/.virtualenvs/dogme/lib/python2.5/site-packages/_mysql.so
anyone understand what's wrong ?
I had a similar problem, look my traceback:
What I did was to put this variables in my
.bash_profile
:And when I ran a Python CGI application with Apache I set this same variable with SetEnv directive:
And everything is working now.