本文翻译自:ImportError: No module named requests
Whenever I try to import requests
, I get an error saying No module Named requests
. 每当我尝试导入requests
,都会收到一条错误requests
,提示“ No module Named requests
。
import requests
The error I get: 我得到的错误:
File "ex2.py", line 1, in <module>
import requests
ImportError: No module named requests
#1楼
参考:https://stackoom.com/question/1Acw4/ImportError-没有名为请求的模块
#2楼
Requests is not a built in module (does not come with the default python installation), so you will have to install it: Requests不是内置模块(默认的python安装不附带),因此您必须安装它:
OSX/Linux OSX / Linux
Use $ sudo pip install requests
(or pip3 install requests