虚拟环境安装
若安装失败,可能权限不够,需要在根用户下安装。
安装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
根据提示,我们使用下面的指令install这个包:
conda install --channel https://conda.anaconda.org/Reinier pytorch
(2)window下,我们找到了一个可用的torch包,名为mwcraig/boost-vpython 。
接着,我们使用show指令来查看该包的详细情况:
anaconda show mwcraig/boost-vpython
根据提示,我们使用下面的指令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)
应加上更新参数:
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包的时候默认使用了一个已经废弃的下载地址。
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
常用的镜像网站
清华大学:Simple Index
中国科学技术大学: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
审核编辑:汤梓红
-
虚拟环境
+关注
关注
0文章
26浏览量
8910 -
python
+关注
关注
53文章
4709浏览量
83711 -
Shell
+关注
关注
1文章
358浏览量
23019
发布评论请先 登录
相关推荐
jmeter压测报错的解决办法
IAR编译器报错问题的解决办法
STM32烧录出现The core is locked up的原因及解决办法
keil5 出现Internal command error报错解决办法
![keil5 <b class='flag-5'>出现</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时出现报错问题的解决办法
![使用Proteus仿真LCD1602时<b class='flag-5'>出现</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)
评论