使用 pip 安装下载的 tar.gz 个文件
Installing downloaded tar.gz files with pip
当我从 http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ 下载 PyGUI-2.5.4.tar.gz
然后 运行
pip install downloads/PyGUI-2.5.4.tar.gz
我收到一个很长的错误,其根源如下:
tarfile.ReadError: not a gzip file
知道我做错了什么吗?
您可以安装 tar.gz 用 pip 安装特定的源存档文件。
pip install ./Package-1.0.4.tar.gz
您也可以通过提取 tar.gz 文件来安装它。首先,您应该使用 tar 命令提取它。
tar -xzvf PyGUI-2.5.4.tar.gz
cd PyGUI-2.5.4.tar.gz
然后使用setup.py文件安装包。
python setup.py install
或
sudo python setup.py install
(仅在 linux 中使用 sudo )
来源:https://pip.readthedocs.io/en/stable/reference/pip_install/#git
安装的正确语法是:
pip install --user ./Downloads/PyGUI-2.5.4.tar.gz
--user
用于授予安装包所需的权限。始终检查路径中的正确路径和大小写(您的路径是 'downloads' 和小 'd' )。
当我从 http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ 下载 PyGUI-2.5.4.tar.gz
然后 运行
pip install downloads/PyGUI-2.5.4.tar.gz
我收到一个很长的错误,其根源如下:
tarfile.ReadError: not a gzip file
知道我做错了什么吗?
您可以安装 tar.gz 用 pip 安装特定的源存档文件。
pip install ./Package-1.0.4.tar.gz
您也可以通过提取 tar.gz 文件来安装它。首先,您应该使用 tar 命令提取它。
tar -xzvf PyGUI-2.5.4.tar.gz
cd PyGUI-2.5.4.tar.gz
然后使用setup.py文件安装包。
python setup.py install
或
sudo python setup.py install
(仅在 linux 中使用 sudo )
来源:https://pip.readthedocs.io/en/stable/reference/pip_install/#git
安装的正确语法是:
pip install --user ./Downloads/PyGUI-2.5.4.tar.gz
--user
用于授予安装包所需的权限。始终检查路径中的正确路径和大小写(您的路径是 'downloads' 和小 'd' )。