通过python 3 shell访问请求模块

时间:2016-11-07 13:05:36

标签: python-3.x

我一直在尝试从python IDLE,Python终端和windows cmd访问/使用请求模块。 该模块在windows cmd以及IDLE上都能很好地响应。但是,当我尝试从Python终端导入它时,这就是我得到的。所以我整个上午都在论坛上阅读不同的主题,但似乎没有像我的一样。有人可以帮助指出可能导致这种情况的原因。我检查了代理设置,但它始终设置为自动检测设置,因此它不符合我的猜测。提前谢谢。

>>> import requests
Traceback (most recent call last):
  File "C:\Python35\lib\site-packages\requests\packages\urllib3\connection.py", line 12, in <module>
    from http.client import HTTPConnection as _HTTPConnection
ImportError: No module named 'http.client'; 'http' is not a package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python35\lib\site-packages\requests\packages\__init__.py", line 27, in <module>
    from . import urllib3
  File "C:\Python35\lib\site-packages\requests\packages\urllib3\__init__.py", line 8, in <module>
    from .connectionpool import (
  File "C:\Python35\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 35, in <module>
    from .connection import (
  File "C:\Python35\lib\site-packages\requests\packages\urllib3\connection.py", line 15, in <module>
    from httplib import HTTPConnection as _HTTPConnection
ImportError: No module named 'httplib'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python35\lib\site-packages\requests\__init__.py", line 63, in <module>
    from . import utils
  File "C:\Python35\lib\site-packages\requests\utils.py", line 23, in <module>
    from .compat import parse_http_list as _parse_list_header
  File "C:\Python35\lib\site-packages\requests\compat.py", line 11, in <module>
    from .packages import chardet
  File "C:\Python35\lib\site-packages\requests\packages\__init__.py", line 29, in <module>
    import urllib3
ImportError: No module named 'urllib3'

0 个答案:

没有答案