问题
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?
回答1:
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
回答2:
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' ).
来源:https://stackoverflow.com/questions/43419975/installing-downloaded-tar-gz-files-with-pip