在 Jupiter 笔记本中运行“导入火炬”时,我收到“没有名为“火炬”的模块

时间:2021-03-17 18:08:54

标签: python terminal

所以.. 当我在 Mac 上打开终端(使用 .zsh)并输入命令时:pip3 install torch torchvision

输出包含: Requirement already satisfied: torchvision in /usr/local/lib/python3.8/site-packages (0.9.0) Requirement already satisfied: typing-extensions in /usr/local/lib/python3.8/site-packages (from torch) (3.7.4.3)

我想我需要将 pip 的位置更改为新路径吗?我不确定将我的 pip 移到哪里,或者具体如何执行此操作,以解决我的问题。

1 个答案:

答案 0 :(得分:0)

如果您有 conda,请尝试使用它。

  1. 通过 conda 检查 jupiter notebook

    conda list

  2. 安装jupiter notebook

    conda install jupyter

  3. 尝试:

    conda update conda

    conda install mkl=2018

最后参考:https://discuss.pytorch.org/t/issues-installing-pytorch-for-os-x-with-conda/11496