python 下载慢 pip 国内源下载

(1)pip国内的一些镜像
阿里云 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 statsmodels -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.douban.com

python37 -m pip install torch1.5.1+cpu torchvision0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

pip install torch1.5.1+cpu torchvision0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

pip install pygame -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.douban.com

!!!

#pip install --upgrade jupyter
a.临时使用:

可以在使用pip的时候在后面加上-i参数,指定pip源

示例: pip install bs4-i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.douban.com 后边这个代码是信任这个网址的意思
库名称
pip install torchtext -i http://pypi.mirrors.ustc.edu.cn/simple/ --trusted-host pypi.mirrors.ustc.edu.cn
普通的:pip install scipy==1.2.1 速度很慢
国内源变形:pip install --user tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple/ 指定国内源速度很快
此处空格

python37 -m pip install transformers -i https://pypi.tuna.tsinghua.edu.cn/simple

pip install torch-geometric -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install PyHamcrest==1.9.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install torch_scatter-1.0.2 (1).tar.gz

pip install torch_scatter-latest+cpu-cp36-cp36m-win_amd64.whl

进入anadacon创建的pytorch屋子环境 conda activate pytorch

torch安装包:网址:https://download.pytorch.org/whl/torch_stable.html

conda pip install torch1.5.1+cpu torchvision0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

cp35是支持python3.5版本的文件

pytorch离线安装网址

pytorch官网:https://pytorch.org/

一、清华镜像源方案
该方案就是将官网的下载路径,改到清华镜像源的路径,先用activate激活自己之前创建的环境后,在命令行输入以下代码:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

conda config --set show_channel_urls yes

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

然后再去pytorch官网复制下载代码,记得删掉后面的-c pytorch,因为它表示从官网进行下载,不从清华镜像源下。

python37 -m pip install torch1.5.1+cpu torchvision0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

你可能感兴趣的:(python,tensorflow,python,pytorch,深度学习)