【问题标题】:Why is Tensorflow always automatically installed?为什么 TensorFlow 总是自动安装?
【发布时间】:2019-06-03 01:48:22
【问题描述】:

我有一个安装 Tensorflow-gpu 的虚拟环境,因为我安装的依赖项如下:

pip install -r requirements.txt

在我的 requirements.txt 中,我列出了以下内容:

tensorflow-gpu==1.13.1

当我执行上述命令后使用“pip freeze”检查时,我看到只安装了tensorflow-gpu,这是正确的。

但是,当我运行时:

“点安装-e。”

从我项目的本地目录中,它显示所有其他依赖项都已经满足,这是正确的,因为我已经按照上面的方式安装了,除了它还在安装“tensorflow”,它没有在 requirements.txt 中列出。

现在,如果我再次运行“pip freeze”,我可以看到两者都已安装:

tensorboard==1.13.1
tensorflow==1.13.1
tensorflow-estimator==1.13.0
tensorflow-gpu==1.13.1

"tensorflow=1.13.1" 没有在 requirements.txt 中列出,但是为什么在我运行 'pip install -e .' 之后添加它?我不想安装它。

【问题讨论】:

  • mby 因为它是 tensorflow-gpu 的一部分,所以对智能 pip 感到高兴

标签: python tensorflow


【解决方案1】:

因为 tensorflow 是 requirements.txt 中列出的包之一或 requirements.txt 中的包之一依赖于它,所以 pip 将在 require.txt 中看到 package1 并安装它可能依赖的所有其他包,然后是第二个依赖项和以此类推。

【讨论】:

  • 首先,tensorflow 没有在 requirements.txt 中列出。其次,如果其中一个包依赖于它,为什么当我运行“pip install -r requirements.txt”时它没有出现。它仅在我运行“pip install -e .”时安装。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-02-02
  • 1970-01-01
  • 1970-01-01
  • 2023-03-15
相关资源
最近更新 更多