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 2.7 as that would pretty much destroy the OS, but get pythonbrew instead, that manages multiple python installations.
I tried installing pythonbrew, but the curl install (curl -kL https://raw.githubusercontent.com/utahta/pythonbrew/master/pythonbrew-install | bash
) did not work for me: it was not picking up my http proxy from env, and then not passing it to the install script, once I provided it on the command line. I downloaded the pythonbrew bits manually and then used python setup.py install to install it. I did it as root and it seemed to work (installing under /root/.pythonbrew, which was not the best), however I could not use it as a different user on the system (permission problems). After some more reading I executed the script correctly as root user and it installed pythonbrew to /usr/local/pythonbrew (yay).
Now, when I execute the following as root or non root user, it waits for a while and then the prompt comes back with no error or any other information (--verbose makes no difference):
root@xxx:~/.pythonbrew/scripts/pythonbrew# pythonbrew install 2.6
root@xxx:~/.pythonbrew/scripts/pythonbrew#
Any ideas? I'm guessing this has something to do with the proxy again, but I'm completely new to python so any pointers are welcome.
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!