如何给各种软件设置代理

以下均用127.0.0.1:7890代替代理的地址

git

sh
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890

npm、pnpm

sh
npm config set proxy http://127.0.0.1:7890
npm config set https-proxy http://127.0.0.1:7890

pip、conda

换源

可以选清华源、中科大源等

但是某校网被清华源拉黑了,所以用的腾讯源

sh
pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple

代理

sh
pip install <package> --proxy="http://127.0.0.1:7890"
资源收藏
Linux中断