Question

I have been trying for a few hours to get distribute_setup.py to install correctly in an active virtual environment. I get it to run, but I always get an error. Any help would be appreciated. I am currently trying to do this in Ubuntu 12.10.

Thanks!

 python distribute_setup.py
 Extracting in /tmp/tmpvmrkpz
 Traceback (most recent call last):
 File "distribute_setup.py", line 546, in <module>
 sys.exit(main())
 File "distribute_setup.py", line 543, in main
 return _install(tarball, _build_install_args(options))
 File "distribute_setup.py", line 76, 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
 (DjangoTutorial) test@ubuntu:~$ 

(DjangoTutorial) is the active virtual environment

Here is what I get when I try to build the dependencies

test@ubuntu:~/Code/Tutorial$ sudo apt-get build-dep python3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: You must put some 'source' URIs in your sources.list
test@ubuntu:~/Code/Tutorial$ 

Python3.3 is installed in /usr/local/lib

I also tried reinstalling ubuntu and python3.3 and it still doesnt work!

Was it helpful?

Solution

This doesnt seem like a virtual environment problem. Rather a problem of missing dependencies for your python installation. Try

sudo apt-get build-dep python3

Then try to configure and build python3.3 again. Also add the -dev package

sudo apt-get install python3.3-dev

Now try installing your package. Most likely you want to create your virtual environment again.

tarfile.py tries to open the tarball using one of the four extraction methods (tar, gzip, bz2, xopen) and it errors out if it cant find respective modules in the python library, some of which might not be included in the base python package.

OTHER TIPS

distribute_setup.py will attempt to download the package (from the net) and then install it. Perhaps your download cannot complete for some reason and that is why the next step (Extracting the tarball) fails.

You can try to download the source from here and then install it manually.

  1. Extract the downloaded tar

    $ tar -xzvf distribute-0.6.36.tar.gz

  2. Change to the extracted directory

    $ cd distribute-0.6.36

  3. Run install

    $ python setup.py install

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top