为了账号安全,请及时绑定邮箱和手机立即绑定

模块不发现错误:没有名为“请求”的模块,即使在 Pycharm 中安装了 pip 请求

模块不发现错误:没有名为“请求”的模块,即使在 Pycharm 中安装了 pip 请求

SMILET 2022-09-27 09:54:46
以前“请求”库正在工作,但我想做一个项目并安装一些库,并且“request==2.22.0”包含在库中。安装库后,我发现我在PyCharm上收到一个错误:Traceback (most recent call last):  File "C:/Users/User/Desktop/python/projects/youtube downloader.py", line 5, in <module>    import requestsModuleNotFoundError: No module named 'requests'当我尝试使用pip再次安装请求时,我不断收到这些错误,我也尝试卸载请求,然后重新安装:C:\Users\User>pip3 install requestsRequirement already satisfied: requests in c:\users\muffin\anaconda3\lib\site-packages (2.21.0)Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\User\appdata\roaming\python\python37\site-packages (from requests) (3.0.4)Requirement already satisfied: idna<2.9,>=2.5 in c:\users\User\appdata\roaming\python\python37\site-packages (from requests) (2.8)Requirement already satisfied: urllib3<1.25,>=1.21.1 in c:\users\User\appdata\roaming\python\python37\site-packages (from requests) (1.24.1)Requirement already satisfied: certifi>=2017.4.17 in c:\users\User\appdata\roaming\python\python37\site-packages (from requests) (2018.11.29)C:\Users\User>pip install requestsRequirement already satisfied: requests in c:\users\muffin\anaconda3\lib\site-packages (2.21.0)Requirement already satisfied: idna<2.9,>=2.5 in c:\users\User\appdata\roaming\python\python37\site-packages (from requests) (2.8)Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\User\appdata\roaming\python\python37\site-packages (from requests) (3.0.4)Requirement already satisfied: urllib3<1.25,>=1.21.1 in c:\users\User\appdata\roaming\python\python37\site-packages (from requests) (1.24.1)Requirement already satisfied: certifi>=2017.4.17 in c:\users\User\appdata\roaming\python\python37\site-packages (from requests) (2018.11.29)我注意到我有两个?我的电脑里有蟒蛇,但我从来没有知道我应该用两条蟒蛇做什么(我用Ananconda来表示木星笔记本和PyCharm),我假设这可能是为什么pip不能像我预期的那样工作的问题......还是不行。我很困惑。++所以我在木星笔记本上发现,我可以毫无问题地导入请求库,所以我认为我需要在另一条路径上下载库???..任何人都可以帮忙吗?提前非常感谢你。
查看完整描述

1 回答

?
呼唤远方

TA贡献1856条经验 获得超11个赞

您尚未为 PyCharm 配置蟒蛇解释器。按照本教程,你应该没问题。我建议使用蟒蛇并创建一个虚拟环境,无论是手动还是在PyCharm内部。安装到该环境。requests



查看完整回答
反对 回复 2022-09-27
  • 1 回答
  • 0 关注
  • 99 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信