Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
651 views
in Technique[技术] by (71.8m points)

python-3.x - ModuleNotFoundError:没有名为“ requests”的模块。 但是“请求”已经安装(ModuleNotFoundError: No module named 'requests'. But 'requests' already installed)

Trying to import 'requests' . (尝试导入'requests' 。)

Has it installed via pip3 install requests? (是否已通过pip3安装请求进行安装?) But still, have this error. (但是仍然有此错误。)

C:UsersVikentiy>pip3 list
Package    Version
---------- ----------
certifi    2018.11.29
chardet    3.0.4
Django     2.1.7
idna       2.8
pip        19.0.2
pytz       2018.9
requests   2.21.0
setuptools 40.6.2
simplejson 3.16.0
urllib3    1.24.1
virtualenv 16.4.0

C:UsersVikentiy>python --version
Python 3.7.2

Error Traceback: (错误回溯:)

C:UsersVikentiyuntitled2venvScriptspython.exe C:/Users/Vikentiy/untitled2/requeststests.py 
Traceback (most recent call last): 
File "C:/Users/Vikentiy/untitled2/requeststests.py", line 1, in <module> import requests`
  ask by vikentii translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

@python3 (@ python3)

Try using (尝试使用)

import urllib.request

Only if you trying to work with urllib (仅当您尝试使用urllib时)

Else try to uninstall requests and then again install it using pip (其他尝试卸载请求,然后再次使用pip安装它)

pip uninstall requests

and again install it (然后重新安装)

pip install requests

or if you did'nt get what I am saying so please visit (或者如果您听不懂我的意思,请访问)

https://scmquest.com/resolved-importerror-no-module-named-requests-usr-bin-python-no-module-named-pip-on-macos/ (https://scmquest.com/resolved-importerror-no-module-named-requests-usr-bin-python-no-module-named-pip-on-macos/)

or (要么)

Import urllib.request, ImportError: No module named request (导入urllib.request,ImportError:没有名为请求的模块)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.8k users

...