【问题标题】:How to install python modules when installed using make altinstall?使用 make altinstall 安装时如何安装 python 模块?
【发布时间】:2020-02-24 10:50:06
【问题描述】:

我目前在 Debian GNU/Linux 上,并且我预装了 python2.7 和 python3.5,所以我再次使用 make altinstall 安装了 python3.8。

现在我有python3和python3.8的两个版本。然后我使用 pip3 install tensorflow-gpu 安装了 tensorflow 模块,当我打开 python3.8 并尝试导入 tensorflow 时,它说找不到模块。

如果是这样,我该如何为 python3.8 安装模块?

【问题讨论】:

  • 你的PYTHONPATH 是什么?它仍然指向 3.5 吗?
  • 我怎么知道它指向哪里?
  • 如果你只是运行pip3 --version,它应该会告诉你它指向的目录...

标签: python pip


【解决方案1】:

https://docs.python.org/3/installing/index.html这里提到如何安装相应的python库。

python2   -m pip install SomePackage  # default Python 2
python2.7 -m pip install SomePackage  # specifically Python 2.7
python3   -m pip install SomePackage  # default Python 3
python3.8 -m pip install SomePackage  # specifically Python 3.8

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-02-25
    • 2018-11-17
    • 1970-01-01
    • 2017-07-24
    • 2016-04-08
    • 1970-01-01
    相关资源
    最近更新 更多