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

查看:344
本文介绍了如何在不使用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.

如果有人可以解释如何以这种方式安装python软件包而无需在Windows上使用pip install的话,那就太棒了.

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:\Users\absolutefilepathtotarunpackedfolder
  • 完成的
  • 然后运行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:\Users\absolutefilepathtotarunpackedfolder
  • Then run python setup.py install

感谢传说帕多瓦&雨果·霍诺姆

Thanks Tales Padua & Hugo Honorem

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

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