会话ImportError:无法从“ requests.sessions”导入名称“ session”。为什么会出现此错误?

时间:2019-12-26 05:21:03

标签: python session python-requests importerror

import requests

url = 'https://api.pwnedpasswords.com/range/' + 'passwords123'
res = requests.get()
print(res)

运行:

Traceback (most recent call last):
  File "C:.py", line 1, in <module>

    import requests
  File "C:\Users\akhter\PycharmProjects\helloworld\venv\lib\site-packages\requests\__init__.py", line 116, in <module>
    from .sessions import session, Session
ImportError: cannot import name 'session' from 'requests.sessions' (C:\Users\akhter\PycharmProjects\helloworld\venv\lib\site-packages\requests\sessions.py)

任何人都可以解释一下,为什么会出现此错误?

0 个答案:

没有答案