如何在不使用 pip install 的情况下从 tar.gz 文件安装 Python 包 [英] How to install Python packages from the tar.gz file without using pip install

查看:21
本文介绍了如何在不使用 pip install 的情况下从 tar.gz 文件安装 Python 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

长话短说,我的工作计算机有网络限制,这意味着尝试在 cmd 中使用 pip install 只会导致超时/找不到包错误.

Long story short my work computer has network constraints which means trying to use pip install in cmd just leads to timing out/not finding package errors.

例如;当我尝试 pip install seaborn 时:

For example; when I try to pip install seaborn:

相反,我尝试下载我想要的软件包的 tar.gz 文件,但是,我不知道如何安装它们.我已经从 tar.gz 文件中提取了文件,其中有一个设置"文件,但它对我没有多大作用.

Instead I have tried to download the tar.gz file of the packages I want, however, I do not know how to install them. I've extracted the files from the tar.gz file and there is a "setup" file within but it's not doing much for me.

如果有人能解释如何在 Windows 上不使用 pip install 以这种方式安装 python 包,那就太棒了.

If someone could explain how to install python packages in this manner without using pip install on windows that would be amazing.

推荐答案

多亏了下面的答案,我已经可以正常工作了.

Thanks to the answers below combined I've got it working.

  • 首先需要将 tar.gz 文件解压到一个文件夹中.
  • 然后在运行 python setup.py install 之前必须将 cmd 指向正确的文件夹.我是通过 pushd C:Usersabsolutefilepathtotarunpackedfolder
  • 做到的
  • 然后运行python setup.py install
  • First needed to unpack the tar.gz file into a folder.
  • Then before running python setup.py install had to point cmd towards the correct folder. I did this by pushd C:Usersabsolutefilepathtotarunpackedfolder
  • Then run python setup.py install

感谢故事帕多瓦 &雨果·霍诺姆

Thanks Tales Padua & Hugo Honorem

这篇关于如何在不使用 pip install 的情况下从 tar.gz 文件安装 Python 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆