您好,欢迎来到气吉美食网。
搜索
您的当前位置:首页macosx安装mysqlmysql

macosx安装mysqlmysql

来源:气吉美食网


两天的折腾结果: 问题一:

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 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/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
关闭mysql 重新安装mysql-python:
admin$:mysql.server stop
admin$:sudo pip uninstall MySQL-python
admin$:sudo pip install MySQL-python

问题二:

 Traceback (most recent call last):
 ...
 import MySQLdb
 File "/Users/cole/Library/Python/2.5/site-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 architecture

pip uninstall MySQL-python
brew uninstall mysql
brew install mysql --universal
pip install MySQL-python

Copyright © 2019- qejl.cn 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务