V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
lxy
V2EX  ›  Python

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

  •  
  •   lxy · 2016-01-15 00:23:26 +08:00 · 7428 次点击
    这是一个创建于 3038 天前的主题,其中的信息可能已经有所发展或是发生改变。
    系统 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 库。
    6 条回复    2016-01-17 01:07:29 +08:00
    imkh
        1
    imkh  
       2016-01-15 00:31:07 +08:00
    lxy
        2
    lxy  
    OP
       2016-01-15 00:37:00 +08:00
    @imkh No package mysql-connector-python available
    我之前也试过了
    imkh
        3
    imkh  
       2016-01-15 00:39:48 +08:00   ❤️ 1
    @lxy 加个 epel 源就有了
    lxy
        4
    lxy  
    OP
       2016-01-15 01:07:17 +08:00
    @imkh 终于安装上了,但是只有 py2.7 能用,可能会是什么原因?
    SYB
        5
    SYB  
       2016-01-15 01:34:04 +08:00
    python3 和 mysql-connector-python 不太兼容。可以用 mysqlclient 。
    staticor
        6
    staticor  
       2016-01-17 01:07:29 +08:00
    考虑使用 virtualenv 或 pyenv 来管理多种不同 python 版本
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5892 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 06:34 · PVG 14:34 · LAX 23:34 · JFK 02:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.