pip、conda第三方库、pip install -r requirement、tensorflow安装太慢或者安装失败

pip安装第三方库太慢

1、终端或控制台中最好解决办法:

pip install 库名 -i 国内镜像源

例如:
# 使用清华镜像源
pip install  Django  -i  https://pypi.tuna.tsinghua.edu.cn/simple
# 使用豆瓣镜像源
pip install  Django -i   http://pypi.douban.com/simple/
# 使用阿里镜像源
pip install  Django -i  http://mirrors.aliyun.com/pypi/simple/
2、pycharm中最好解决方法

在这里插入图片描述按照图中顺序配置国内镜像源,即可。

pip安装失败

python -m pip install -U --force-reinstall pip install django

pip install -r requirement.txt安装慢

linux系统永久配置快速安装

# 创建.pip文件夹
mkdir ~/.pip
cd ~/.pip
# 创建pip.conf文件
touch pip.conf
sudo vi ~/.pip/pip.conf
# 将以下内容增加到pip.conf文件中
[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com

conda安装慢

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

即可添加 Anaconda Python 免费仓库。

直接粘贴复制以上代码即可。另外,要一行一行运行,并且每一行运行完没有任何结果,直接运行下一行即可。

三行代码运行完,可以运行 conda install numpy 测试一下吧。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值