mysql-connector-python 安装失败,何解?

2016-01-15 00:23:26 +08:00
 lxy
系统 CentOS 6 ,原本已有 Python 2.7 ,后来装了 Python 3.5 , pip 安装 mysql-connector-python 的时候报错说找不到合适的版本,我以为是 py3.5 较新,于是删除了 py3.5 ,装 py3.4.3 ,问题依旧。

```bash
> pip3 install mysql-connector-python
Collecting mysql-connector-python
Could not find a version that satisfies the requirement mysql-connector-python (from version: )
No matching distribution found for mysql-connector-python
```
而且到 MySQL 官网也找不到 CentOS 的安装包( https://dev.mysql.com/downloads/connector/python/)。难道要我换系统吗?

PS. Project 已写好,不打算更换其它 MySQL 库。
7440 次点击
所在节点    Python
6 条回复
imkh
2016-01-15 00:31:07 +08:00
lxy
2016-01-15 00:37:00 +08:00
@imkh No package mysql-connector-python available
我之前也试过了
imkh
2016-01-15 00:39:48 +08:00
@lxy 加个 epel 源就有了
lxy
2016-01-15 01:07:17 +08:00
@imkh 终于安装上了,但是只有 py2.7 能用,可能会是什么原因?
SYB
2016-01-15 01:34:04 +08:00
python3 和 mysql-connector-python 不太兼容。可以用 mysqlclient 。
staticor
2016-01-17 01:07:29 +08:00
考虑使用 virtualenv 或 pyenv 来管理多种不同 python 版本

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/250849

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX