linux上安裝完torch後仍報錯:linux
Traceback (most recent call last): File "cifar10_tutorial.py", line 58, in <module> import torch ImportError: No module named torch
是由於還要進行環境配置:vim
首先進入:bash
vim ~/.bashrc
添加下面的語句:spa
. /home/yourdirectory/torch/install/bin/torch-activate # added by Anaconda3 installer export PATH="/home/yourdirectory/anaconda3/bin:$PATH"
而後更新一下環境變量就能夠了code
source ~/.bashrc