pyenv proxy not work on MAC

4.5k views Asked by At

As described in the title, the following config, doesn't enable the proxy.

export http_proxy="socks5://127.0.0.1:1080"
export http_proxys="socks5://127.0.0.1:1080"

pyenv install 3.5.2

is there other methods?

3

There are 3 answers

2
Kyan On BEST ANSWER

no inline version of the answer from @Leon:

export https_proxy=socks5://127.0.0.1:1080
# do something
unset https_proxy
0
Leon On

After try lots of methods, it can only work in this way:

https_proxy=socks5://127.0.0.1:1080 pyenv install -v 3.5.2
0
crifan On

Add proxy for pyenv not work

here:

export HTTP_PROXY=http://127.0.0.1:58591; export HTTPS_PROXY=http://127.0.0.1:58591; export ALL_PROXY=socks5://127.0.0.1:51837

pyenv install -v 3.10.6

and

https_proxy=socks5://127.0.0.1:51837 pyenv install -v 3.10.6

not work

Workaround: manually download and move to pyenv cache

except use proxy, if you just want to speed up pyenv, another way is:

manually download python zip file, put into pyenv cache

steps:

  1. download https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
    • which show when pyenv install 3.7.3
    • eg
      • wget: wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
      • wget use https proxy: wget -e "https_proxy=https://127.0.0.1:58591" https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
  2. move downloaded Python-3.7.3.tar.xz into ~/.pyenv/cache
    • create folder mkdir ~/.pyenv/cache if not existed