作为项目自动安装的一部分,我尝试安装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日的评论:
根据PEP470使用PyPI链接到非PyPI托管的包以供自动安装程序下载的索引应为空的索引(/
/ index)已被弃用并计划删除。受影响包的维护者在3个月前收到了电子邮件。删除发生在今天早些时候(一个bug导致了一些oackages,比如托管在PyPI上的Twisted,它们的链接也被删除了,但已经被修复)。MySQL-connector-python的维护者应该上传到PyPI,或者指示他们的用户在他们维护的存储库中使用-f或--extra-index-url。
怎样才能顺利安装mysql-connector-python==1.0.12
?我需要建立自己的存储库吗?
发布于 2015-12-28 16:00:25
有相当多的解决方案,例如托管一个私有存储库,但最快的是将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
发布于 2016-02-10 23:43:59
对于所有像我这样的懒人,他们不得不搜索需求文件是如何工作的
就是这么做的...
echo https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.1.3.tar.gz >> requirements.txt
然后是这个。
sudo -H pip install -r ./requirements.txt
检查一下。
pip list | grep mysql
它应该输出:
mysql-connector-python (2.1.3)
感谢@Amnon,快乐的日子
发布于 2017-03-15 09:05:24
为我工作,我使用
pip install mysql-connector-python-rf
。
https://stackoverflow.com/questions/34489271
复制相似问题