pythonbrew
pythonbrew copied to clipboard
Pythonbrew fails to install distribute
root@omer-VirtualBox:~/.pythonbrew/dists# python3 distribute_setup.py
Extracting in /tmp/tmp3udj3v
Traceback (most recent call last):
File "distribute_setup.py", line 494, in <module>
main(sys.argv[1:])
File "distribute_setup.py", line 490, in main
_install(tarball, _build_install_args(argv))
File "distribute_setup.py", line 73, in _install
tar = tarfile.open(tarball)
File "/home/omer/.pythonbrew/pythons/Python-3.2/lib/python3.2/tarfile.py", line 1744, in open
raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully
I tried it on 2.7.2 as well. Same result.
Tried running with sudo and without sudo. Same results.
I'm on ubuntu 11.10.
Turns out that on Ubuntu you have to run the following script:
sudo apt-get install build-essential
sudo apt-get install libncursesw5-dev
sudo apt-get install libreadline-gplv2-dev
sudo apt-get install libssl-dev
sudo apt-get install libgdbm-dev
sudo apt-get install libbz2-dev
sudo apt-get install libc6-dev
sudo apt-get install libsqlite3-dev
sudo apt-get install tk-dev
This gets all the dependencies that python uses to build itself. You can cherrypick them but for distribute zlib and bz2 (I'm not sure about bz2) are a must. This should be specified in the docs.
If python still doesn't recognize zlib and fails to install distribute try installing dpkg-dev as the python install script uses it to find out where libz.so is.
sudo apt-get install dpkg-dev
I have failed to get setuptools instaled for 2.7.x versions of brewed pythons. No matter if I do it manually or omitting --no-setuptools command I get this output on my environment:
Installing Python-2.7.3 into /home/amer/.pythonbrew/pythons/Python-2.7.3 Downloading distribute_setup.py as /home/amer/.pythonbrew/dists/distribute_setup.py ######################################################################## 100,0% Installing distribute into /home/amer/.pythonbrew/pythons/Python-2.7.3 ERROR: Failed to install setuptools. See /home/amer/.pythonbrew/build.log to see why. Skip installation of setuptools.
Installed Python-2.7.3 successfully. Run the following command to switch to Python-2.7.3. pythonbrew switch 2.7.3 Switched to Python-2.7.3 asking libproxy about url 'http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg' libproxy suggest to use 'direct://' --2012-08-05 21:51:02-- http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg Resolving pypi.python.org (pypi.python.org)... 82.94.164.168 Connecting to pypi.python.org (pypi.python.org)|82.94.164.168|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 332005 (324K) [application/octet-stream] Saving to: `setuptools-0.6c11-py2.7.egg'
100%[===================================================================================================================================================>] 332.005 541K/s in 0,6s
2012-08-05 21:51:02 (541 KB/s) - `setuptools-0.6c11-py2.7.egg' saved [332005/332005]
sh: ./setuptools--0.6c9-py2.7.egg: No such file or directory
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to
On Debian Squeeze, installing libbz2-dev and zlib1g-dev (and rebuilding 2.7.3) solved the issue.
libssl-dev is also needed for httplib to support https connections
Can confirm that installing libbz2-dev zlib1g-dev has fixed the problem.
I have the same problem when installing Python 2.5 with --configure="--enable-shared", even after installing all those dependencies. I'm running Debian GNU/Linus 5.0.
Running python distribute_setup.py works OK.