Windows 下的 pip 配置文件路径:%HOMEPATH%/pip/pip.ini
文件,如不存在则新建,在其中写入:阿里云
[global] index-url = http://pypi.douban.com/simple trusted-host = pypi.douban.com disable-pip-version-check = true timeout = 120 [install] ignore-installed = true # 不自动安装依赖的时候设置此选项 # no-dependencies = yes [list] format = columns
注:url
index-url
- 使用豆瓣源format
- 当运行 pip list
命令时,等效于 pip list --format=columns
,避免出现相关警告。Linux 系统pip配置文件默认路径为:code
~/.pip/pip.conf
若是用的阿里云,则默认配置文件为:orm
[global] index-url = http://mirrors.aliyun.com/pypi/simple/ [install] trusted-host=mirrors.aliyun.com
可是阿里云pypi更新比较缓慢,换成注释掉相关配置,换成官方源。
另附清华源配置:ip
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple
设置清华大学镜像:ci
conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/' conda config --set show_channel_urls yes
参考:清华大学开源软件镜像站get