码迷,mamicode.com
首页 > 系统相关 > 详细

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

时间:2019-03-19 17:10:34      阅读:5824      评论:0      收藏:0      [点我收藏+]

标签:vat   cal   name   tor   rect   cto   last   vim   ash   

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

 

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

标签:vat   cal   name   tor   rect   cto   last   vim   ash   

原文地址:https://www.cnblogs.com/wanghui-garcia/p/10559385.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!