虛擬環(huán)境安裝
若安裝失敗,可能權(quán)限不夠,需要在根用戶下安裝。
安裝torch
pip install torch
或者使用:
conda install torch
報(bào)錯(cuò)PackageNotFound
錯(cuò)誤信息:
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下,我們找到了一個(gè)可用的torch包,名為Reinier/pytorch 。
接著,我們使用show指令來查看該包的詳細(xì)情況:
anaconda show Reinier/pytorch
根據(jù)提示,我們使用下面的指令install這個(gè)包:
conda install --channel https://conda.anaconda.org/Reinier pytorch
(2)window下,我們找到了一個(gè)可用的torch包,名為mwcraig/boost-vpython 。
接著,我們使用show指令來查看該包的詳細(xì)情況:
anaconda show mwcraig/boost-vpython
根據(jù)提示,我們使用下面的指令install這個(gè)包:
conda install --channel https://conda.anaconda.org/mwcraig boost-vpython
報(bào)錯(cuò)Requirement already satisfied
錯(cuò)誤信息:
Requirement already satisfied: torch in /home/snowstorm/.conda/envs/snowstorm/lib/python3.6/site-packages (0.1)
應(yīng)加上更新參數(shù):
pip install torch --upgrade
報(bào)錯(cuò)Requirement already up-to-date
錯(cuò)誤信息:
Requirement already up-to-date: torch in /home/snowstorm/.conda/envs/snowstorm/lib/python3.6/site-packages (0.1)
是因?yàn)樵谙螺dtorch包的時(shí)候默認(rèn)使用了一個(gè)已經(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)站
清華大學(xué):Simple Index
中國科學(xué)技術(shù)大學(xué):Simple Index
阿里云:Simple Index
豆瓣 :Simple Index
華中理工大學(xué):http://pypi.hustunique.com/
山東理工大學(xué):http://pypi.sdutlinux.org/
報(bào)錯(cuò)Could not install packages due to an EnvironmentError
錯(cuò)誤信息:
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文章
29瀏覽量
9059 -
python
+關(guān)注
關(guān)注
56文章
4827瀏覽量
86761 -
Shell
+關(guān)注
關(guān)注
1文章
372瀏覽量
24221
發(fā)布評(píng)論請(qǐng)先 登錄
jmeter壓測(cè)報(bào)錯(cuò)的解決辦法
IAR編譯器報(bào)錯(cuò)問題的解決辦法
STM32燒錄出現(xiàn)The core is locked up的原因及解決辦法
高頻PCB設(shè)計(jì)過程中出現(xiàn)電源噪聲的解決辦法
keil5 出現(xiàn)Internal command error報(bào)錯(cuò)解決辦法

stm32 win7 64位虛擬串口驅(qū)動(dòng)安裝失敗解決辦法

使用Proteus仿真LCD1602時(shí)出現(xiàn)報(bào)錯(cuò)問題的解決辦法

pip安裝更換鏡像
pip安裝后仍有ImportError No module named XX問題解決
pip安裝報(bào)錯(cuò):Command python setup.py egg_info failed with error code 1

評(píng)論