【问题标题】:Pip3 showing different version of tensorflow libraryPip3 显示不同版本的 tensorflow 库
【发布时间】:2018-10-21 19:53:54
【问题描述】:

当我这样做时

python3 -c 'import tensorflow as tf; print(tf.__version__)'

我得到 1.3.0

当我这样做时

pip3 show tensorflow

我得到 1.8.0

为什么我在 paperspace.com 上的同一台 Ubuntu linux 机器上得到不同版本的 tensorflow

【问题讨论】:

  • 您的 pip3 关联的 python 是否与您的 python3 匹配?
  • 如何检查?
  • 刚刚给出了检查tensorflowsite-packages 的答案。请检查一下。

标签: python-3.x tensorflow pip


【解决方案1】:

我不确定,但我认为您的系统中可能有多个 Python 发行版,并且您的 pip3 关联的 Python 与您的 python3 不匹配。

  1. 检查你的“两个”(潜在的)张量流:

    python3 -c 'import tensorflow as tf; print(tf.__file__)'
    

    pip3 show tensorflow # And look for "Location: ..."
    
  2. 检查您的 pip3python3 相关站点包:

    python3 -m site
    
    #Or
    
    python3 -c "import site; print(site.getsitepackages())"
    

    pip --version
    

【讨论】:

    猜你喜欢
    • 2019-02-02
    • 2019-04-14
    • 2020-10-04
    • 2019-07-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多