pythonshell在导入MySQLdb时显示错误
我使用MySQLConnector将Python与MySQLdb连接起来,但现在出现以下错误pythonshell在导入MySQLdb时显示错误,python,mysql,Python,Mysql,我使用MySQLConnector将Python与MySQLdb连接起来,但现在出现以下错误 Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import MySQLdb File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import MySQLdb
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.6-intel.egg/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.6-intel.egg/_mysql.so, 2): Symbol not found: _mysql_affected_rows
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.6-intel.egg/_mysql.so
Expected in: flat namespace in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.6-intel.egg/_mysql.so
使用自制软件安装后,我发现以下错误
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
import _mysql
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.6-intel.egg/_mysql.so, 2): Symbol not found: _mysql_affected_rows
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.6-intel.egg/_mysql.so
Expected in: flat namespace in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.6-intel.egg/_mysql.so
从您的回溯来看,您正在使用OSX原生python。我可能建议您尝试使用自制python,在切换之前,我经常遇到兼容性问题。请在您的问题“使用MySQLConnector”中澄清。回溯显示您没有使用MySQL连接器/Python。你真的像egg说的那样使用MacOS X 10.6吗?我安装了MySQLConnector,现在使用的是OS X 10.9-我太困惑了,不知道该怎么办:s