1.打开终端,输入以下命令,生成.condarc文件
conda config --set show_channel_urls yes
2.在.condarc里输入以下内容
auto_activate_base: false
ssl_verify: true
channels:
- defaults
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
show_channel_urls: true
proxy_servers:
http: http://127.0.0.1:19964
https: http://127.0.0.1:19964
修改proxy_servers部分即可,如果加一个http不好使,在加一个https试试
此时给conda配置了代理,但是pip代理还是不好使
3.使用pip install <packagename> --proxy="http://192.168.9.99:3128"
即可