Yosemitie上MySQL的问题

时间:2015-09-02 21:40:32

标签: mysql django macos mysql-python

我已经下载了一个使用MySQL的新Django存储库,安装后我在运行syncdb命令时遇到了一些奇怪的错误

我最初收到以下错误

  raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
  django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/splashlin/Developer/project/venv/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: /usr/local/lib/libmysqlclient.18.dylib
  Referenced from: /Users/splashlin/Developer/project/venv/lib/python2.7/site-packages/_mysql.so
  Reason: image not found

我尝试用

修复它
 sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /Library/Python/2.7/site-packages/_mysql.so

但是得到

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: /Library/Python/2.7/site-packages/_mysql.so (No such file or directory)

任何人对如何解决问题都有任何想法?现在相当困难。谢谢!

1 个答案:

答案 0 :(得分:0)

尝试下载并安装(或重新安装)MySql的Python连接器

http://dev.mysql.com/downloads/connector/python/

问候