问题描述
尝试运行 Python 脚本时出现此错误.我已经下载了一个 requests-1.2.0 文件夹,但我不知道如何处理它.我试过运行下载中包含的 setup.py 文件,但它只是打开命令终端一秒钟然后关闭.
Getting this error when trying to run a Python script. I have downloaded a requests-1.2.0 folder but I have no idea what to do with it. I've tried running the setup.py file contained in the download but it just opens a command terminal for a second and closes.
我从我的 Windows 桌面运行 Python,而不是在服务器或类似的东西上.
I am running Python from my Windows desktop, not on a server or anything like that.
不知道我在这里做什么!
No idea what I'm doing here!
推荐答案
从你下载的 requests 文件夹的根目录,运行:
from the root directory of the requests folder you downloaded, run:
$ python setup.py install
然后它将在系统范围内安装,并且您的脚本可能会使用导入请求"
then it will be installed system-wide, and your scripts may use "import requests"
这篇关于导入错误:没有名为“请求"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!