简体   繁体   English

不用 pip 安装 Python 包

[英]Installing Python packages without pip

I've been banging my head against the wall all day.我整天都在用头撞墙。 The laptop I use won't allow access to the outside to use pip.我使用的笔记本电脑不允许访问外部以使用 pip。 So I went to pypi.org and downloaded the request package.于是我去pypi.org下载了请求包。 I've unpacked it into the python/lib folder.我已经将它解压到 python/lib 文件夹中。

I then go to the command line and navigate to the new folder and run the python setup.py install.然后我转到命令行并导航到新文件夹并运行 python setup.py install。

I've never done this before so I was expecting some feedback from the install.我以前从未这样做过,所以我期待从安装中得到一些反馈。

nothing.没有什么。

I'm using VS as my IDE.我使用 VS 作为我的 IDE。

Any thoughts here?这里有什么想法吗?

I found this as a work around我发现这是一种解决方法

python -m pip install ....

Python is an environmental variable. Python 是一个环境变量。 The laptop I'm working on is a work laptop that I need to return, but since my personal laptop died (no boot device was found was that last information it reported).我正在使用的笔记本电脑是我需要归还的工作笔记本电脑,但由于我的个人笔记本电脑坏了(没有找到启动设备是它报告的最后一条信息)。 I am probably not set up as an administrator on this device.我可能没有在此设备上设置为管理员。 Hope this might help you.希望这可以帮助你。

I think you have set it up correctly.我认为你已经正确设置了它。 For whatever package you are installing you need to very carefully read the full instructions.对于您正在安装的任何软件包,您都需要非常仔细地阅读完整说明。 After you are sure that you have set it up correctly you can check by running a simple python script I found on this question:在确定已正确设置后,您可以通过运行我在此问题上找到的简单 python 脚本进行检查:

Check if Python Package is installed 检查是否安装了 Python 包

You would then just change the module name to the module you tried to install.然后您只需将模块名称更改为您尝试安装的模块。 Hopefully, this helps!希望这会有所帮助!

* EDIT You might also need to run the command terminal as an administrator depending on how your computer is set up. *编辑您可能还需要以管理员身份运行命令终端,具体取决于您的计算机的设置方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM