Installing downloaded tar.gz files with pip

55k Views Asked by At

When I download PyGUI-2.5.4.tar.gz from http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ and then run

pip install downloads/PyGUI-2.5.4.tar.gz

I get a long error, the root of which appears to be the following:

tarfile.ReadError: not a gzip file

Any ideas what I'm doing wrong?

2

There are 2 best solutions below

3
On BEST ANSWER

You can install tar.gz with pip Install a particular source archive file.

pip install ./Package-1.0.4.tar.gz

You can also install it with extracting tar.gz file. First you should extract it using using tar command.

tar -xzvf PyGUI-2.5.4.tar.gz
cd PyGUI-2.5.4.tar.gz

And then use the setup.py file to install the package .

python setup.py install

or

sudo python setup.py install

( use sudo only in linux )

Source: https://pip.readthedocs.io/en/stable/reference/pip_install/#git

1
On

The correct syntax for the installation is:

pip install --user ./Downloads/PyGUI-2.5.4.tar.gz

The --user is used to give the necessary permissions to install the package. Always check for the correct path and Upper and Lower case in your path(Your path was to 'downloads' with small 'd' ).