Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/96.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在OSX上使用MySQLdb时出现问题:未找到符号\u mysql\u受影响的\u行_Python_Mysql_Macos - Fatal编程技术网

Python 在OSX上使用MySQLdb时出现问题:未找到符号\u mysql\u受影响的\u行

Python 在OSX上使用MySQLdb时出现问题:未找到符号\u mysql\u受影响的\u行,python,mysql,macos,Python,Mysql,Macos,这是有关的 然而,那里发布的主要解决方案并不适合我。我在雪豹上,使用32位5.1.49 MySQL dmg安装。我使用的是内置python(显然,正如评论中所指出的,我的python版本不同),它看起来是2.6.5 32位的: Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "

这是有关的

然而,那里发布的主要解决方案并不适合我。我在雪豹上,使用32位5.1.49 MySQL dmg安装。我使用的是内置python(显然,正如评论中所指出的,我的python版本不同),它看起来是2.6.5 32位的:

Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.maxint 2147483647 Python 2.6.5(r265:793592010年3月24日01:32:55) [GCC 4.0.1(苹果公司5493版)]关于达尔文 有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证”。 >>>导入系统 >>>sys.maxint 2147483647 我从下载了MySQL python 1.2.3,并更改了site.cfg,以便MySQL\u config指向正确的位置,并注释掉registry\u key指令。这些软件包似乎构建和安装得很好:

caywork:MySQL-python-1.2.3 carl$ python setup.py clean running clean caywork:MySQL-python-1.2.3 carl$ python setup.py build running build running build_py copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.6/MySQLdb running build_ext caywork:MySQL-python-1.2.3 carl$ sudo python setup.py install running install running bdist_egg running egg_info writing MySQL_python.egg-info/PKG-INFO writing top-level names to MySQL_python.egg-info/top_level.txt writing dependency_links to MySQL_python.egg-info/dependency_links.txt reading manifest file 'MySQL_python.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'MANIFEST' warning: no files found matching 'ChangeLog' warning: no files found matching 'GPL' writing manifest file 'MySQL_python.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.3-fat/egg running install_lib running build_py copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.6/MySQLdb running build_ext creating build/bdist.macosx-10.3-fat/egg copying build/lib.macosx-10.3-fat-2.6/_mysql.so -> build/bdist.macosx-10.3-fat/egg copying build/lib.macosx-10.3-fat-2.6/_mysql_exceptions.py -> build/bdist.macosx-10.3-fat/egg creating build/bdist.macosx-10.3-fat/egg/MySQLdb copying build/lib.macosx-10.3-fat-2.6/MySQLdb/__init__.py -> build/bdist.macosx-10.3-fat/egg/MySQLdb copying build/lib.macosx-10.3-fat-2.6/MySQLdb/connections.py -> build/bdist.macosx-10.3-fat/egg/MySQLdb creating build/bdist.macosx-10.3-fat/egg/MySQLdb/constants copying build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/__init__.py -> build/bdist.macosx-10.3-fat/egg/MySQLdb/constants copying build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/CLIENT.py -> build/bdist.macosx-10.3-fat/egg/MySQLdb/constants copying build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/CR.py -> build/bdist.macosx-10.3-fat/egg/MySQLdb/constants copying build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/ER.py -> build/bdist.macosx-10.3-fat/egg/MySQLdb/constants copying build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/FIELD_TYPE.py -> build/bdist.macosx-10.3-fat/egg/MySQLdb/constants copying build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/FLAG.py -> build/bdist.macosx-10.3-fat/egg/MySQLdb/constants copying build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/REFRESH.py -> build/bdist.macosx-10.3-fat/egg/MySQLdb/constants copying build/lib.macosx-10.3-fat-2.6/MySQLdb/converters.py -> build/bdist.macosx-10.3-fat/egg/MySQLdb copying build/lib.macosx-10.3-fat-2.6/MySQLdb/cursors.py -> build/bdist.macosx-10.3-fat/egg/MySQLdb copying build/lib.macosx-10.3-fat-2.6/MySQLdb/release.py -> build/bdist.macosx-10.3-fat/egg/MySQLdb copying build/lib.macosx-10.3-fat-2.6/MySQLdb/times.py -> build/bdist.macosx-10.3-fat/egg/MySQLdb byte-compiling build/bdist.macosx-10.3-fat/egg/_mysql_exceptions.py to _mysql_exceptions.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/MySQLdb/__init__.py to __init__.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/MySQLdb/connections.py to connections.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/__init__.py to __init__.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/CLIENT.py to CLIENT.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/CR.py to CR.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/ER.py to ER.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/FIELD_TYPE.py to FIELD_TYPE.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/FLAG.py to FLAG.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/REFRESH.py to REFRESH.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/MySQLdb/converters.py to converters.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/MySQLdb/cursors.py to cursors.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/MySQLdb/release.py to release.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/MySQLdb/times.py to times.pyc creating stub loader for _mysql.so byte-compiling build/bdist.macosx-10.3-fat/egg/_mysql.py to _mysql.pyc creating build/bdist.macosx-10.3-fat/egg/EGG-INFO copying MySQL_python.egg-info/PKG-INFO -> build/bdist.macosx-10.3-fat/egg/EGG-INFO copying MySQL_python.egg-info/SOURCES.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO copying MySQL_python.egg-info/dependency_links.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO copying MySQL_python.egg-info/top_level.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO writing build/bdist.macosx-10.3-fat/egg/EGG-INFO/native_libs.txt zip_safe flag not set; analyzing archive contents... creating 'dist/MySQL_python-1.2.3-py2.6-macosx-10.3-fat.egg' and adding 'build/bdist.macosx-10.3-fat/egg' to it removing 'build/bdist.macosx-10.3-fat/egg' (and everything under it) Processing MySQL_python-1.2.3-py2.6-macosx-10.3-fat.egg Removing /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQL_python-1.2.3-py2.6-macosx-10.3-fat.egg Copying MySQL_python-1.2.3-py2.6-macosx-10.3-fat.egg to /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages MySQL-python 1.2.3 is already the active version in easy-install.pth Installed /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQL_python-1.2.3-py2.6-macosx-10.3-fat.egg Processing dependencies for MySQL-python==1.2.3 Finished processing dependencies for MySQL-python==1.2.3 caywork:MySQL-python-1.2.3 carl$python setup.py clean 干净利落 caywork:MySQL-python-1.2.3 carl$python setup.py build 运行构建 运行build\u py 正在复制MySQLdb/release.py->build/lib.macosx-10.3-fat-2.6/MySQLdb 运行build_ext caywork:MySQL-python-1.2.3 carl$sudo python setup.py安装 正在运行的安装 运行bdist_蛋 运行蛋_信息 编写MySQL\u python.egg-info/PKG-info 将顶级名称写入MySQL_python.egg-info/top_level.txt 正在将依赖项链接写入MySQL\u python.egg-info/dependency\u links.txt 正在读取清单文件“MySQL_python.egg info/SOURCES.txt” 正在读取清单模板“manifest.in” 警告:找不到与“清单”匹配的文件 警告:找不到与“ChangeLog”匹配的文件 警告:找不到与“GPL”匹配的文件 正在编写清单文件“MySQL_python.egg info/SOURCES.txt” 将库代码安装到build/bdist.macosx-10.3-fat/egg 正在运行安装库 运行build\u py 正在复制MySQLdb/release.py->build/lib.macosx-10.3-fat-2.6/MySQLdb 运行build_ext 创建build/bdist.macosx-10.3-fat/egg 正在复制build/lib.macosx-10.3-fat-2.6//u mysql.so->build/bdist.macosx-10.3-fat/egg 正在复制build/lib.macosx-10.3-fat-2.6//u mysql\u exceptions.py->build/bdist.macosx-10.3-fat/egg 创建build/bdist.macosx-10.3-fat/egg/MySQLdb 正在复制build/lib.macosx-10.3-fat-2.6/MySQLdb/_init__uu.py->build/bdist.macosx-10.3-fat/egg/MySQLdb 正在复制build/lib.macosx-10.3-fat-2.6/MySQLdb/connections.py->build/bdist.macosx-10.3-fat/egg/MySQLdb 创建build/bdist.macosx-10.3-fat/egg/MySQLdb/constants 正在复制build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/_init__uuu.py->build/bdist.macosx-10.3-fat/egg/MySQLdb/constants 正在复制build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/CLIENT.py->build/bdist.macosx-10.3-fat/egg/MySQLdb/constants 正在复制build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/CR.py->build/bdist.macosx-10.3-fat/egg/MySQLdb/constants 正在复制build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/ER.py->build/bdist.macosx-10.3-fat/egg/MySQLdb/constants 正在复制build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/FIELD_TYPE.py->build/bdist.macosx-10.3-fat/egg/MySQLdb/constants 正在复制build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/FLAG.py->build/bdist.macosx-10.3-fat/egg/MySQLdb/constants 正在复制build/lib.macosx-10.3-fat-2.6/MySQLdb/constants/REFRESH.py->build/bdist.macosx-10.3-fat/egg/MySQLdb/constants 正在复制build/lib.macosx-10.3-fat-2.6/MySQLdb/converters.py->build/bdist.macosx-10.3-fat/egg/MySQLdb 正在复制build/lib.macosx-10.3-fat-2.6/MySQLdb/cursors.py->build/bdist.macosx-10.3-fat/egg/MySQLdb 正在复制build/lib.macosx-10.3-fat-2.6/MySQLdb/release.py->build/bdist.macosx-10.3-fat/egg/MySQLdb 正在复制build/lib.macosx-10.3-fat-2.6/MySQLdb/times.py->build/bdist.macosx-10.3-fat/egg/MySQLdb 字节编译build/bdist.macosx-10.3-fat/egg//\u mysql\u exceptions.py到\u mysql\u exceptions.pyc 字节编译build/bdist.macosx-10.3-fat/egg/MySQLdb/_init__.py到_init__.pyc 字节编译build/bdist.macosx-10.3-fat/egg/MySQLdb/connections.py到connections.pyc 字节编译build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/_init__u;.py到_init__;.pyc 字节编译build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/CLIENT.py到CLIENT.pyc 字节编译build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/CR.py到CR.pyc 字节编译build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/ER.py到ER.pyc 字节编译build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/FIELD_TYPE.py到FIELD_TYPE.pyc 字节编译build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/FLAG.py到FLAG.pyc 字节编译build/bdist.macosx-10.3-fat/egg/MySQLdb/constants/REFRESH.py到REFRESH.pyc 字节编译build/bdist.macosx-10.3-fat/egg/MySQLdb/converters.py到converters.pyc 字节编译build/bdist.macosx-10.3-fat/egg/MySQLdb/cursors.py到cursors.pyc 字节编译build/bdist.macosx-10.3-fat/egg/MySQLdb/release.py到release.pyc 字节编译build/bdist.macosx-10.3-fat/egg/MySQLdb/times.py到times.pyc 为_mysql.so创建存根加载器 字节编译build/bdist.macosx-10.3-fat/egg//u mysql.py到_mysql.pyc 创建build/bdist.macosx-10.3-fat/egg/egg-INFO 正在复制MySQL_python.egg-info/PKG-info->build/bdist.macosx-10.3-fat/egg/egg-info 正在复制MySQL_python.egg-info/SOURCES.txt->build/bdist.macosx-10.3-fat/egg/egg-info 正在复制MySQL\u python.egg-info/dependency\u links.txt->build/bdist.macosx-10.3-fat/egg/egg-info 正在复制MySQL\u python.egg-info/top\u level.txt->build/bdist.macosx-10.3-fat/egg/egg-info 编写build/bdist.macosx-10.3-fat/egg/egg-INFO/native_libs.txt 未设置zip_安全标志;正在分析存档内容。。。 创建'dist/MySQL_python-1.2.3-py2.6-macosx-10.3-fat.egg'并添加'build/bdist.macosx-10.3-fat/egg' 删除“build/bdist.macosx-10.3-fat/egg”(及其下的所有内容) 处理MySQL_python-1.2.3-py2.6-macosx-10.3-fat.egg 删除/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQL_Python-1.2.3-py2.6-macosx-10.3-fat.egg 正在将MySQL_python-1.2.3-py2.6-macosx-10.3-fat.egg复制到/Library/Frameworks/python.framework/Versions/2.6/lib/python2.6/site-packages MySQL python 1.2.3已经是easy-install.pth中的活动版本 已安装/Library/Frameworks/Python.framework/Ve caywork:MySQL-python-1.2.3 carl$ python -c "import MySQLdb" /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQL_python-1.2.3-py2.6-macosx-10.3-fat.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQL_python-1.2.3-py2.6-macosx-10.3-fat.egg/_mysql.pyc, but /Users/carl/Source/MySQL-python-1.2.3 is being added to sys.path Traceback (most recent call last): File "", line 1, in File "MySQLdb/__init__.py", line 19, in import _mysql File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__ ImportError: dlopen(/Users/carl/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.3-fat.egg-tmp/_mysql.so, 2): Symbol not found: _mysql_affected_rows Referenced from: /Users/carl/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.3-fat.egg-tmp/_mysql.so Expected in: dynamic lookup