No module named “Torch”

前端 未结 13 1021
慢半拍i
慢半拍i 2021-01-04 01:41

I installed pytorch via

conda install pytorch-cpu torchvision-cpu -c pytorch

And I also tried

pip3 install https://download.pytorch         


        
13条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 02:24

    I had the same problem after following the official installation guide in here. I realized that it was my stupid Atom built-in terminal.

    Inside the atom terminal, which python returned /usr/bin/python, although it showed the mark of (conda_env)$.

    I fixed it by opening a new terminal and activating the (conda_env), and it worked. Verified and which python yields /Users/my_usr/anaconda3/envs/conda_env/bin/python

提交回复
热议问题