报错
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /usr/local/lib/python2.7/site-packages/_mysql.so
Reason: image not found
解决方法:
不用sudo
ln -s /usr//local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/libmysqlclient.18.dylib
/usr/lib/ 下需要更高的root权限,比较复杂
本文转自Tenderrain 51CTO博客,原文链接:http://blog.51cto.com/tenderrain/2044835,如需转载请自行联系原作者