我刚刚安装了一堆在 python 上使用 MySQL 的软件包,但我不确定是哪一个成功了(不管是哪个,只有在重新启动后才有效)。
现在我想在 virtualenv 上使用它,所以我在本地机器上用 pip freeze 创建了一个 requirements.txt,然后,我创建了一个 virtualenv 并尝试了 pip install -r requirements.txt。但是,无法安装任何软件包,错误是:
Could not find a version that satisfies the requirement mysql-connector-python<=2.0.4 (from -r myvi/requirements.txt (line 1)) (from versions: )
No matching distribution found for mysql-connector-python<=2.0.4 (from -r myvi/requirements.txt (line 1))
尝试手动编辑文件,但无论第一行是什么,总是报同样的错误。
谷歌搜索这个主题,我只找到了特定于包的解决方案,但无论包如何,我都会得到错误。为什么会这样?
编辑:我认为所有的包都在引发错误,但只有其中一些是。即:
adium-theme-ubuntu==0.3.4
mysql-connector-python==2.0.4
Pyste==0.9.10
unity-lens-photos==1.0
我认为如果它是由 pip freeze 构建的,那么 pip install 就可以了。
请您参考如下方法:
我不知道你之前是怎么安装mysql-connector-python的,但是its PyPI page没有列出其任何版本的任何可下载文件,因此您不能使用 pip 安装它(至少不能使用普通的 pip install mysql-connector-python==2.0.4 或类似)。尝试从 requirements.txt 文件中删除 mysql-connector-python 行。
您提到的其他软件包(adium-theme-ubuntu、Pyste 和 unity-lens-photos)没有甚至存在于 PyPI 上,所以 pip install 肯定对他们不起作用。
