linux上安装完torch后仍报错:ImportError: No module named torch

时间:2019-03-19 17:10:34   收藏:0   阅读:5824

linux上安装完torch后仍报错:

Traceback (most recent call last):
  File "cifar10_tutorial.py", line 58, in <module>
    import torch
ImportError: No module named torch 

是因为还要进行环境配置:

首先进入:

vim ~/.bashrc

添加下面的语句:

. /home/yourdirectory/torch/install/bin/torch-activate
# added by Anaconda3 installer
export PATH="/home/yourdirectory/anaconda3/bin:$PATH"

然后更新一下环境变量就可以了

source ~/.bashrc

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!