两天的折腾结果: 问题一:
import MySQLdb Traceback (most recent call last): File stdin, line 1, in module File /Library/Python/2.7/site-packages/MySQLdb/__init__.py, line 19, in module import _mysql ImportError: dlopen(/Library/Python/2.7/
两天的折腾结果:
问题一:
import MySQLdbTraceback (most recent call last):File "<stdin>", line 1, in <module>File "/Library/Python/2.7/site-packages/MySQLdb/__init__.py", line 19, in <module>import _mysqlImportError: dlopen(/Library/Python/2.7/site-packages/_mysql.so, 2): Symbol not found: _mysql_affected_rowsReferenced from: /Library/Python/2.7/site-packages/_mysql.soExpected in: flat namespacein /Library/Python/2.7/site-packages/_mysql.so关闭mysql 重新安装mysql-python:admin$:mysql.server stopadmin$:sudo pip uninstall MySQL-pythonadmin$:sudo pip install MySQL-python
问题二:
Traceback (most recent call last): ... import MySQLdb File "/Users/cole/Library/Python/2.5/s<i style="color:transparent">本文来源gaodai$ma#com搞$$代**码网$</i>ite-packages/MySQLdb/__init__.py", line 19, in <module> import _mysql ImportError: dlopen(/Users/cole/Library/Python/2.5/site-packages/_mysql.so, 2): Library not loaded: /usr/local/lib/libmysqlclient.18.dylib Referenced from: /Users/cole/Library/Python/2.5/site-packages/_mysql.so Reason: no suitable image found. Did find: /usr/local/lib/libmysqlclient.18.dylib: mach-o, but wrong architecture /usr/local/lib/libmysqlclient.18.dylib: mach-o, but wrong architecturepip uninstall MySQL-pythonbrew uninstall mysqlbrew install mysql --universalpip install MySQL-python