qpython 安装mysql_Q: 无法在Mac OS10.12.3上安装MySQLPython

我正试图导入MySQLdb,而它来了:>>> import MySQLdb

Traceback (most recent call last):

File "", line 1, in

ImportError: No module named MySQLdb

所以我开始安装MySQLdb,方法是:

^{pr2}$

但是,我得到了错误信息:Collecting MySQL-Python

Using cached MySQL-python-1.2.5.zip

Installing collected packages: MySQL-Python

Running setup.py install for MySQL-Python ... error

Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/y4/qxwc6ps56fv6bc94vyp3ccjr0000gn/T/pip-build-ejJODG/MySQL-Python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/y4/qxwc6ps56fv6bc94vyp3ccjr0000gn/T/pip-pLamdE-record/install-record.txt --single-version-externally-managed --compile:

以及cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. -Qunused-arguments -Qunused-arguments build/temp.macosx-10.12-intel-2.7/_mysql.o -L/usr/local/Cellar/mysql/5.6.27/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.12-intel-2.7/_mysql.so

ld: library not found for -lssl

clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: command 'cc' failed with exit status 1

然后,我试了一下:export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib"

但这没有任何意义。

然后我尝试了另一种方法:sudo pip install mysql-connector-python

然而,它也不起作用:Collecting mysql-connector-python

Could not find a version that satisfies the requirement mysql-connector-python (from versions: )

No matching distribution found for mysql-connector-python

因为我是mac和python的新手,我不知道发生了什么以及如何修复它。我已经在我的电脑里安装了python2.7.10。在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值