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>
  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?

  • did you compile python3.3 without zlib-devel available?
    – Matt
    Sep 10, 2013 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.
    – Pratap
    Sep 11, 2013 at 13:34

2 Answers 2


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.


yum -y update

Let's download the installation file using wget:

wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz

Extract the files from the archive:

tar -xvf setuptools-1.4.2.tar.gz

Enter the extracted directory:

cd setuptools-1.4.2

Install setuptools using the Python we've installed (2.7.6)

python2.7 setup.py install

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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