虛擬環(huán)境安裝
若安裝失敗,可能權(quán)限不夠,需要在根用戶下安裝。
安裝torch
pip install torch
或者使用:
conda install torch
報錯PackageNotFound
錯誤信息:
Fetching package metadata ...........
PackageNotFoundError: Package missing in current linux-64 channels:
- torch
Close matches found; did you mean one of these?
torch: pytorch, libtorch
可以使用下面的指令來查找我們想要安裝的torch包:
anaconda search -t conda torch
如上圖所示。
(1)在Linux下,我們找到了一個可用的torch包,名為Reinier/pytorch 。
接著,我們使用show指令來查看該包的詳細情況:
anaconda show Reinier/pytorch
根據(jù)提示,我們使用下面的指令install這個包:
conda install --channel https://conda.anaconda.org/Reinier pytorch
(2)window下,我們找到了一個可用的torch包,名為mwcraig/boost-vpython 。
接著,我們使用show指令來查看該包的詳細情況:
anaconda show mwcraig/boost-vpython
根據(jù)提示,我們使用下面的指令install這個包:
conda install --channel https://conda.anaconda.org/mwcraig boost-vpython
報錯Requirement already satisfied
錯誤信息:
Requirement already satisfied: torch in /home/snowstorm/.conda/envs/snowstorm/lib/python3.6/site-packages (0.1)
應(yīng)加上更新參數(shù):
pip install torch --upgrade
報錯Requirement already up-to-date
錯誤信息:
Requirement already up-to-date: torch in /home/snowstorm/.conda/envs/snowstorm/lib/python3.6/site-packages (0.1)
是因為在下載torch包的時候默認使用了一個已經(jīng)廢棄的下載地址。
1.刪除/home/snowstorm/.conda/envs/snowstorm/lib/python3.6/site-packages (0.1)下的torch文件
2.更改更新命令,加入下載鏡像地址:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple torch
常用的鏡像網(wǎng)站
清華大學:Simple Index
中國科學技術(shù)大學:Simple Index
阿里云:Simple Index
豆瓣 :Simple Index
華中理工大學:http://pypi.hustunique.com/
山東理工大學:http://pypi.sdutlinux.org/
報錯Could not install packages due to an EnvironmentError
錯誤信息:
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/anaconda3/lib/python3.7/site-packages/llvmlite-0.28.0.dist-info'
Consider using the
--user
option or check the permissions.
需要加上--user:pip install 改為 pip install --user
pip install --user -i https://pypi.tuna.tsinghua.edu.cn/simple torch
審核編輯:湯梓紅
-
虛擬環(huán)境
+關(guān)注
關(guān)注
0文章
28瀏覽量
8978 -
python
+關(guān)注
關(guān)注
56文章
4811瀏覽量
85082 -
Shell
+關(guān)注
關(guān)注
1文章
366瀏覽量
23478
發(fā)布評論請先 登錄
相關(guān)推薦
jmeter壓測報錯的解決辦法
IAR編譯器報錯問題的解決辦法
STM32燒錄出現(xiàn)The core is locked up的原因及解決辦法
高頻PCB設(shè)計過程中出現(xiàn)電源噪聲的解決辦法
keil5 出現(xiàn)Internal command error報錯解決辦法
![keil5 <b class='flag-5'>出現(xiàn)</b>Internal command error<b class='flag-5'>報錯</b><b class='flag-5'>解決辦法</b>](https://file.elecfans.com/web1/M00/D9/4E/pIYBAF_1ac2Ac0EEAABDkS1IP1s689.png)
使用Proteus仿真LCD1602時出現(xiàn)報錯問題的解決辦法
![使用Proteus仿真LCD1602時<b class='flag-5'>出現(xiàn)</b><b class='flag-5'>報錯</b>問題的<b class='flag-5'>解決辦法</b>](https://file.elecfans.com/web1/M00/D9/4E/pIYBAF_1ac2Ac0EEAABDkS1IP1s689.png)
pip安裝更換鏡像
pip安裝后仍有ImportError No module named XX問題解決
pip安裝報錯:Command python setup.py egg_info failed with error code 1
![<b class='flag-5'>pip</b><b class='flag-5'>安裝</b><b class='flag-5'>報錯</b>:Command python setup.py egg_info failed with error code 1](https://file.elecfans.com/web2/M00/8A/E5/pYYBAGO_uieAYU-QAADIw1NhCig646.png)
評論