我无法使用 pip 安装 mysql-connector-python [英] I cannot install mysql-connector-python using pip

查看:46
本文介绍了我无法使用 pip 安装 mysql-connector-python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to install mysql-connector-python==1.0.12 as part of my project's automated installation, and I get the following error from 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在 bitbucket.org 中.具体而言,以下评论日期为 28/12/2015:

Up until a few days ago it worked fine. I investigated a bit and found the following issue in bitbucket.org. Specifically, the following comment dated 28/12/2015:

这应该是空白的,根据 PEP 470 使用 PyPI 链接到一个包而不是由 PyPI 托管,供自动安装程序下载(/simple/index) 已弃用并计划删除.维护者受影响的包裹是 3 个月前通过电子邮件发送的.搬迁发生了今天早些时候(一个错误导致了一些像 Twisted 这样的 oackages,它们是托管在 PyPI 上也删除了他们的链接,但这已经补救).MySQL-connector-python 的维护者应该要么上传到 PyPI 或指导他们的用户使用 -f 或--extra-index-url 带有他们维护的存储库.

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的安装顺利运行?我需要设置自己的存储库吗?

How can I have the installation of mysql-connector-python==1.0.12 run smoothly? Do I need to set up my own repository?

推荐答案

有很多解决方案,例如托管私有存储库,但最快的是将 requirements.txt 文件更改为从 mysql 的 CDN 下载.

There are quite a few solutions, e.g. hosting a private repository, but the quickest was to change the requirements.txt file to download from mysql's cdn.

即改变:

mysql-connector-python==1.0.12

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

这篇关于我无法使用 pip 安装 mysql-connector-python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆