2017-05-31 69 views
1

我刚刚安装了一堆软件包,在python上使用MySQL,但我不确定哪一种方法可以实现(无论哪种方法,只能在重新启动后才能使用)。无法安装冻结

现在我试图在virtualenv上使用它,所以我在本地机器上用pip冻结创建了一个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)) 

尝试手动编辑的文件,但无论第一线,总是报同样的错误。

使用Google搜索该主题,我只发现特定于包的解决方案,但无论包装如何,我都会收到错误。这是为什么发生?

编辑:我认为所有的软件包都引发错误,但只有一些是。即:

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它。

+0

你能告诉我们你的需求文件的内容吗? (只是几行) –

+0

试试这个https://stackoverflow.com/questions/34489271/i-cannot-install-mysql-connector-python-using-pip – tom

+0

'adium-theme-ubuntu == 0.3.4 cycler == 0.10.0 mysql-connector-python == 2.0.4' (...) –

回答

1

我不知道你是怎么之前安装mysql-connector-python,但its PyPI page没有列出任何可下载的文件,其任何版本的,所以你不能用PIP(安装至少,不是一个普通的pip install mysql-connector-python==2.0.4或喜欢)。尝试删除requirements.txt文件中的mysql-connector-python行。

你提到的其他包(adium-theme-ubuntuPysteunity-lens-photos)甚至不存在PyPI上,所以pip install绝对不会为他们工作。

+0

并不是所有来自pip freeze的软件包都可以通过pip instal安装,其中包含一个错误。添加到你的答案,我会接受它。 –