ModuleNotFoundError: No module named 'requests' 用PCcharm
时间: 2023-08-19 21:10:09 浏览: 167
回答: 当出现ModuleNotFoundError: No module named 'requests'的错误时,通常是因为没有导入requests库。你可以尝试在脚本当前目录下运行以下代码来安装requests库:pip install requests。如果你在PCcharm中运行代码,可以在终端中执行相同的命令来安装requests库。另外,你也可以尝试进入/usr/bin目录并使用sudo pip3 install requests命令来安装requests库。最后,你可以在Python交互环境中执行import requests来检查是否安装成功。\[1\]\[2\]
#### 引用[.reference_title]
- *1* [ModuleNotFoundError: No module named 'requests' 解决方案](https://blog.csdn.net/weixin_48505549/article/details/130920712)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [mac ModuleNotFoundError: No module named ‘requests](https://blog.csdn.net/yh_852974543/article/details/127592504)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文