Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to install setuptools with no success so far. When I do

python3.3 ez_setup.py

I get the following error:

Extracting in /tmp/tmp6nn4cz
Traceback (most recent call last):
  File "ez_setup.py", line 370, in <module>
    sys.exit(main())
  File "ez_setup.py", line 367, in main
    return _install(tarball, _build_install_args(options))
  File "ez_setup.py", line 55, in _install
    tar = tarfile.open(tarball)
  File "/usr/local/lib/python3.3/tarfile.py", line 1571, in open
    raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully

I've been reading and it seems that zlib-devel was not installed when the python installation was done. However, I did uncomment line 358 on Modules/Setup to enable zlib before compiling and if I try to

import zlib

on python3.3 console it works. Also, in case it helps, here is the ldd python3.3:

# ldd `which python3.3`
    linux-vdso.so.1 =>  (0x00007fff79fda000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b96092da000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00002b96094f6000)
    libutil.so.1 => /lib64/libutil.so.1 (0x00002b96096fa000)
    libz.so.1 => /lib64/libz.so.1 (0x00002b96098fe000)
    libm.so.6 => /lib64/libm.so.6 (0x00002b9609b12000)
    libc.so.6 => /lib64/libc.so.6 (0x00002b9609d95000)
    /lib64/ld-linux-x86-64.so.2 (0x00002b96090bc000)

What can I do?

share|improve this question
    
did you compile python3.3 without zlib-devel available? –  mtm Sep 10 '13 at 19:12
    
The error "tarfile.ReadError: file could not be opened successfully" says that the file downloaded by ez_setup.py is not accessible. Possibly either you are behind any firewall/proxy which is not letting it download properly. You may download these files manually and try installing it. –  PratapSingh Sep 11 '13 at 13:34

1 Answer 1

I have the same problem as you (no idea why), after installed zlib-devel then compiled Python 3.3.2 into /usr/local.

As a workaround, the easiest way to get setuptools is just to:

# wget http://pypi.python.org/packages/source/s/setuptools/setuptools-1.1.6.tar.gz --no-check-certificate
# tar xf setuptools-1.1.6.tar.gz
# cd setuptools-1.1.6
# python3.3 setup.py install

Change the versions to your own versions.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.