Two-day tossing results: Question 1: importMySQLdbTraceback (mostrecentcalllast): Filestdin, line1, queue-packagesMySQLdb _ init _. py, line19, encoding: dlopen (LibraryPython2.7
Result of two days: Question 1: 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/
Two days of tossing results:
Question 1:
Import MySQLdb
Traceback (most recent call last ):
File" ", Line 1, in
File "/Library/Python/2.7/site-packages/MySQLdb/_ init _. py", line 19, in
Import _ mysql
ImportError: dlopen (/Library/Python/2.7/site-packages/_ mysql. so, 2): Symbol not found: _ mysql_affected_rows
Referenced from:/Library/Python/2.7/site-packages/_ mysql. so
Expected in: flat namespace
In/Library/Python/2.7/site-packages/_ mysql. so
Close mysql and reinstall mysql-python:
Admin $: mysql. server stop
Admin $: sudo pip uninstall MySQL-python
admin$:sudo pip install MySQL-python
Question 2:
Traceback (most recent call last): ... import MySQLdb File "/Users/cole/Library/Python/2.5/site-packages/MySQLdb/__init__.py", line 19, in
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 architecture
pip uninstall MySQL-pythonbrew uninstall mysqlbrew install mysql --universalpip install MySQL-python
Refer:
http://madebyhoundstooth.com/blog/install-mysql-on-mountain-lion-with-homebrew/
https://gist.github.com/cole/1272701