6

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?

Shane
  • 447
  • 2
  • 6
  • 18
  • what is downloads/ ? is that a directory ? – Tushar Gupta Apr 14 '17 at 22:25
  • Yes, indeed. Sorry for lack of clarity. – Shane Apr 14 '17 at 22:54
  • In case this helps others, I got this error when trying to do this on an archive I downloaded via curl. Upon closer inspection (by running `cat` on my archive), I saw that the actual contents were simply `{"message":"404 File Not Found"}%`... Explains why I couldn't pip install it :) – tvt173 Jul 21 '21 at 04:00

2 Answers2

10

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' ).

Akash Agrawal
  • 231
  • 3
  • 7
4

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

Forhadul Islam
  • 1,159
  • 11
  • 13
  • 3
    I had to use "python setup.py install" – smerlung Aug 08 '17 at 08:19
  • 5
    No, you can install tar.gz with pip https://pip.readthedocs.io/en/stable/reference/pip_install/#git "Install a particular source archive file. $ pip install ./downloads/SomePackage-1.0.4.tar.gz $ pip install http://my.package.repo/SomePackage-1.0.4.zip" – Leo Skhrnkv Sep 18 '17 at 14:38
  • i use `python3 -m pip install .` Once i'm in the folder. `python3 -m pip install /tmp/test.tar.gz` works too, with the gzip of the `.` folder. – yellowsir Sep 24 '22 at 10:51