重新安装python 3.7.3后无法安装需求文件

时间:2019-04-05 09:47:42

标签: python-3.x pip

我的系统上安装了python 3.7(32位),但无法在其上运行TensorFlow,因此我制作了所有软件包的需求文件并卸载了python。安装python 3.7.3(64位)后,我运行了

pip install -r requirements.txt

在同一个目录中具有requirements.txt文件,但出现此错误:

Invalid requirement: 'pip install'

在语法错误的情况下,requests.txt文件的外观如下。

kiwisolver==1.0.1
lxml==4.3.1
MarkupSafe==1.1.0
matplotlib==3.0.2
mglearn==0.1.7
mistune==0.8.4
nbconvert==5.4.0
nbformat==4.4.0
nose==1.3.7
notebook==5.7.4
numpy==1.16.0
pandas==0.24.1

我在做什么错?我搜索了它,然后有一篇帖子告诉我,requirements.txt的语法可能是错误的,但我不知道如何进行转换。

1 个答案:

答案 0 :(得分:0)

在Windows命令提示符中,对于Python 3.7.3版本:-

  

py -3 -m pip freeze > requirements.txt

步骤2:-

  

py -3 -m pip install -r requirements.txt

在macOS和Python 3.7.3版本中:-

  

pip3 freeze > requirements.txt

步骤2:-

  

pip3 install -r requirements.txt

相关问题