使用anaconda自带的python3.7:我的默认安装位置C:\Users\86188\anaconda\python.exe
cmd下的应用命令,默认安装位置C:\Users\86188\下安装
1、pytorch安装对应cuda版本兼容问题
官网:https://pytorch.org/
pytorch旧版本网址:
https://pytorch.org/get-started/previous-versions/
torchvision安装
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple torchvision
验证
import torch
import torchvision
print(torch.cuda.is_available())
pytorch版本查看
import torch
print(torch.__version__)
2、翻墙地址安装:
阿里云
http://mirrors.aliyun.com/pypi/simple/
中国科技大学
https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban)
http://pypi.douban.com/simple/
清华大学
https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学
http://pypi.mirrors.ustc.edu.cn/simple/
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow == 1.0.0
,这样就会从清华这边的镜像去安装tensorflow库。
参数介绍
-U
是 --upgrade
的简写。就是把所有包升级到最新版。
-i 指定翻墙地址
-m
使用“解释器名称 -m pip install XXX”来安装相应的库
同样以我的Python版本为例,
如果我想安装Python2.7的sklearn库,我需要输入的命令是“python2 -m pip install sklearn”
如果我想安装Python3.6的sklearn库,我需要输入的命令是“python -m pip install sklearn”
3、第三方库下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/
可以通过pip install xxx安装