【问题标题】:using different version of package within python anaconda在 python anaconda 中使用不同版本的包
【发布时间】:2020-08-22 18:39:59
【问题描述】:

我看到我在 anaconda2/lib/python2.7/site-packages 中有两个版本的 tensorflow:

  • tensorflow-1.14.0.dist-info/
  • tensorflow-2.1.0.dist-info/

但是当我启动 anaconda2/bin/jupyter qtconsole 时,我总是得到 1.14。如何使用 2.1?

历史可能是这样的:

  1. 1.14自带conda
  2. 我为 2.1 安装了 pip
  3. 我尝试执行“pip install tensorflow-datasets”,但没有成功。
  4. 谷歌搜索建议“conda install -c anaconda tensorflow-datasets”。看起来这组 tensorflow 回到了 1.14
  5. 我尝试了“pip install”“conda install”“conda update”的不同方式,但无法将 tensorflow 升级到 2.1。

谢谢。

【问题讨论】:

  • 卸载tensorflow,然后尝试导入。它显示了什么?
  • 使用 conda 卸载 tensorflow 1.14? 2.1 可能是由 pip 安装的,而 conda 不知何故。
  • 使用“conda reomove”卸载 tensorflow 1.14 无法解决问题,卸载后,使用“pip install”安装会出现错误:警告:在 /nfs/gearrundata/anaconda2/lib/ 中找不到元数据python2.7/site-packages 错误:由于 EnvironmentError 无法安装软件包:[Errno 2] 没有这样的文件或目录:'/anaconda2/lib/python2.7/site-packages/google_pasta-0.2.0.dist-信息/元数据'

标签: python tensorflow anaconda


【解决方案1】:

anaconda 2 无法使用 conda install 安装 tensorflow 2.x,我不得不重新安装 anaconda 2,然后使用 pip install 安装 tf 2.x

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-29
    • 1970-01-01
    • 2020-05-01
    相关资源
    最近更新 更多