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

查看:249
本文介绍了我无法使用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))

直到几天前,它都运行良好.我进行了一些调查,发现以下问题在bitbucket.org 中.具体来说,以下日期为2015年12月28日的评论:

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/ 索引)已弃用,并计划将其删除.的维护者 受影响的软件包已在3个月前通过电子邮件发送.移除发生了 今天早些时候(一个错误引起了诸如Twisted之类的o包, 托管在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天全站免登陆