在Vscode中未能使用python的urllib.request。
我试图在VSCODE中导入urllib.request wth python,但一直收到消息:InvimperRor:无模块命名请求。我只是进口Urllib没有问题,我知道这是Python2的正确行。我确定我正在使用Python3,因为这就是我在解释器路径中选择的。
我还将pip3 install urllib3放在终端中,并收到此消息,这意味着python3应该拥有它:
需求已经满足:urllib3 in/library/frameworks/python.frameworks/python.framework/versions/3.8/lib /Python3.8/site-packages(1.26.9)
有什么想法出了什么问题或不是Python版本的问题?
I tried to import urllib.request wth python in vscode but kept getting the message: ImportError: No module named request. I have no problem importing just urllib, which I know is the right line for python2. I'm sure I'm using python3 as that's what I've selected in the interpreter path.
I've also put pip3 install urllib3 in the terminal and got this message which means python3 should have it:
Requirement already satisfied: urllib3 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (1.26.9)
any idea what have gone wrong or it's not the problem with python version?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这与您的多个环境有关。使用PIP安装软件包时,应指定安装路径。
This is related to your multiple environments. You should specify the installation path when using pip installation package.