mac终端走代理

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_24671941/article/details/83794527

1.一次性有效

直接在终端输入

export ALL_PROXY=http://proxyAddress:port

本次终端有效。

2.长期有效

在 ~/.bach_profile 中添加下面一行

export ALL_PROXY=http://proxyAddress:port

长期有效。

使用的是shadowsocks,需要使用socks5代替http,例如:

export ALL_PROXY=socks5://127.0.0.1:1080

3.问题

针对设置为长期有效的用户,如果使用pip安装第三方库时,报错:

Could not install packages due to an EnvironmentError: Missing dependencies for SOCKS support.

解决方法:

终端输入

unset all_proxy&&unset ALL_PROXY

本次终端有效。

猜你喜欢

转载自blog.csdn.net/qq_24671941/article/details/83794527