pyenv proxy not work on MAC

Question:

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?

Asked By: Leon

||

Answers:

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
Answered By: Leon

no inline version of the answer from @Leon:

export https_proxy=socks5://127.0.0.1:1080
# do something
unset https_proxy
Answered By: Kyan

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
Answered By: crifan
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.