问题记录:运行python程序时,出现报错:ModuleNotFoundError: No module named 'requests'
问题原因:没有安装requests库
解决办法:安装requests库
D:\Program Files\python3\Zyl>pip install requests
Collecting requests
Downloading requests-2.28.2-py3-none-any.whl (62 kB)
---------------------------------------- 62.8/62.8 kB 482.4 kB/s eta 0:00:00
Requirement already satisfied: certifi>=2017.4.17 in d:\program files\python3\lib\site-packages (from requests) (2022.12.7)
Requirement already satisfied: idna<4,>=2.5 in d:\program files\python3\lib\site-packages (from requests) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in d:\program files\python3\lib\site-packages (from requests) (1.26.14)
Collecting charset-normalizer<4,>=2
Downloading charset_normalizer-3.0.1-cp310-cp310-win_amd64.whl (96 kB)
---------------------------------------- 96.5/96.5 kB 927.1 kB/s eta 0:00:00
Installing collected packages: charset-normalizer, requests
Successfully installed charset-normalizer-3.0.1 requests-2.28.2
总结:遇到报错 ModuleNotFoundError: No module named 'XXX',在终端运行pip install XXX解决。
手机扫一扫
移动阅读更方便
你可能感兴趣的文章