0

I want to install django. I have the following instructions to do this:

    wget "http://www.djangoproject.com/download/1.4/tarball/" -O Django-1.4.tar.gz
    tar xzvf Django-1.4.tar.gz
    cd Django-1.4
    sudo python setup.py install

when I run the second line (i.e., tar xzvf Django-1.4.tar.gz) then I get the following message:

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

Is there any problem? Please help me.

  • Probably: wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.djangoproject.com" ... –  May 17 '13 at 12:21

3 Answers3

2

The error can mean 2 things depending on what file you downloaded. In the normal sense, when users download a file not ending with .gz it means the file is not a gzip format.

The other case is when the downloaded file is corrupted. I took my time to download the http://www.djangoproject.com/download/1.4/tarball/ file and it works with the line you are mentioning so it must mean the file was downloaded and somehow got corrupted. Download the file again.

Just to add that I had a problem about a year ago, similar to this, it was a memory problem. One of the memory slots was damaged (Memtest verified this). This is of course an extreme case, but wanted to mention it just in case.

What I would suggest is to do the following:

  1. Download file like this: wget http://www.djangoproject.com/download/1.4/tarball/ -O Django-1.4.tar.gz
    (No double quotes, just in case when copied from a website, they were the bbcode double codes and not the common ones used in the terminal)

  2. Decompress like you mentioned: tar xzvf Django-1.4.tar.gz

See if that works.

Luis Alvarado
  • 211,503
  • do the following, on your browser, go to http://www.djangoproject.com/download/1.4/tarball/ it will automatically start downloading the file. Test with that. – Luis Alvarado Mar 22 '13 at 18:25
0

From https://stackoverflow.com/questions/3950839/tar-error-is-not-recoverable-exiting-now

mv Doctrine-1.2.0.tgz Doctrine-1.2.0.tar.gz
gunzip Doctrine-1.2.0.tar.gz
tar xf Doctrine-1.2.0.tar
0

Please forget about running setup.py from source!

Use pip to install Python packages. It's so much easier and preferred over easy_install / setup.py (Why use pip over easy_install?).

It's as easy as:

  1. Install pip by installing the Ubuntu package: python-pip Install python-pip

  2. Install any package from PyPI like this:

     sudo pip install Django
    

Done. Replace Django with any other package from PyPI.

gertvdijk
  • 67,947