MySQLdb没有在Mac 10.7上运行

时间:2012-02-29 04:18:01

标签: django mysql-python

我正在尝试在我的Mac上本地安装MySQL-Python(MySQLdb),但我遇到了麻烦。我一直在为HOURS工作,我继续得到这个错误:

>>> import MySQLdb
/Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg/_mysql.pyc, but /Users/dp/Code/MySQL-python-1.2.3 is being added to sys.path
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "MySQLdb/__init__.py", line 19, in <module>
    import _mysql
  File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 7, in <module>
  File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/dp/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
  Referenced from: /Users/dp/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so
  Reason: image not found
>>>

我正在尝试建立一个python 2.7 / Django / MySQL开发环境并继续遇到这个问题。我有一种感觉,这可能是我的.bash_profiles PATH的问题,所以我也包括以下内容:

export PATH="/usr/local/mysql/bin:$PATH"

谢谢!!!

DP

0 个答案:

没有答案