pip - 我无法使用 pip 安装 mysql-connector-python

标签 pip pypi mysql-connector-python

我尝试安装 mysql-connector-python==1.0.12 作为项目自动安装的一部分,但我从 pip install 收到以下错误:

Collecting mysql-connector-python==1.0.12 (from -r /tmp/requirements.txt (line 20))
Could not find a version that satisfies the requirement mysql-connector-python==1.0.12 (from -r /tmp/requirements.txt (line 20)) (from versions: )
No matching distribution found for mysql-connector-python==1.0.12 (from -r /tmp/requirements.txt (line 20))

直到几天前,它还运行良好。我调查了一下,发现了以下issue in bitbucket.org 。具体来说,以下评论日期为 2015 年 12 月 28 日:

That should be blank, per PEP 470 using PyPI to link to a package not hosted by PyPI for automated installers to download (the /simple/ index) was deprecated and scheduled for removal. Maintainers of the affected packages were emailed 3 months ago. The removal happened earlier today (a bug caused some oackages like Twisted which were hosted on PyPI to also have their links removed but that has been remedied). The maintainers of MySQL-connector-python should either upload to PyPI or direct their users to use either -f or --extra-index-url with a repository they maintain.

如何让mysql-connector-python==1.0.12安装顺利进行? 我需要设置自己的存储库吗?

最佳答案

有很多解决方案,例如托管私有(private)存储库,但最快的方法是更改​​ requirements.txt 文件以从 mysql 的 cdn 下载。

即改变:

mysql-connector-python==1.0.12

https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.1.15.tar.gz

关于pip - 我无法使用 pip 安装 mysql-connector-python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34489271/

相关文章:

python - Python的python-daemon和daemonize有什么区别?

github - 在自述文件中包含许可证文件

python - 将我的网站上传到公共(public)存储库有哪些风险/好处?

mysql - 实现操纵和插入 sql 记录的算法的最快方法是什么?

python - 使用 python mysql 连接器时如何使用变量作为属性名称

python - 使用 RPM 包与使用 requirements.txt 管理依赖关系

python - 在没有互联网的情况下安装 python 包并使用源代码作为 .tar.gz 和 .whl

python - 安装 simplejson 后没有名为 'json' 的模块

python - 为什么我的 Python 包的分类器没有出现在测试 PyPI 上?

mysql - 在 Python 3.5 中导入 MySQL 连接器时出错