Installing downloaded tar.gz files with pip [duplicate]

余生长醉 提交于 2021-02-16 13:20:34

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!