Skip to content Skip to sidebar Skip to footer

Pythonbrew Does Not Install Python With No Output On Command Line

I'm new to both python, pythonbrew and ubuntu. I need python 2.6 and currently have 2.7 on my ubuntu precise system. Searching online revealed that I should not try to uninstall

Solution 1:

Following the "which pythonbrew" and doing some guessing the following solved my problem: I changed the curl.py file under /usr/local/pythonbrew/scripts/pythonbrew adding proxy setting to read, readheader and fetch functions as follows:

before modification:

p = Popen('curl -skL "%s"' % url, stdout=PIPE, shell=True)

after modification:

p = Popen('curl -x http://<proxy host>:<proxy port> -skL "%s"' % url, stdout=PIPE, shell=True)

I am not sure why there was no output without the proxy setting, but now the install works!

Solution 2:

I also faced this issue today, while installing py2.7.14 with pythonbrew.

The reason it silently fails to install is when it gets the header from the python server (src of py2.7.14), it checks for a return status of success. It implements HTTP/1.1 method check (only) where successful return status is 200 OK.

However, python server uses HTTP/2 and the success return code is in the form 200, there's no trailing OK.

So, to fix it, I added 2 lines of code below following 2 lines in /opt/.pythonbrew/scripts/pythonbrew/curl.py, routine readheader().

if re.match('^HTTP.*? 200 OK$', line):
    break

Added this code below above code:

elif re.match('^HTTP.*? 200$', line):
    break

I did't want to change pythonbrew's code, hence added it with an elif.

This works.

I note that several other people using pyenv also mentions of similar issue, I am presuming similar issue may exist there.

Post a Comment for "Pythonbrew Does Not Install Python With No Output On Command Line"