0

i have been trying to access/work with the request module from the python IDLE, Python terminal and windows cmd. The module responds fine on the windows cmd as well as IDLE. However when i try importing it from Python terminal, this is what i get. So i have been all morning reading different topics on the forum but none seems to be same like mine. Could someone kindly help assist in pointing out what might be causing this. I checked the proxy settings but it has always been set to automatically detect settings so it is out of the way i guess. Thanks in advance.

>>> 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'
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Moe
  • 129
  • 2
  • 11
  • You have a local file named `http.py` imported instead of the standard library, and thus other things break. Remove that file. – Martijn Pieters Nov 07 '16 at 13:06
  • Thnx....all good...i renamed the so called file and now all works well...thnx a lot...this saved me lot of time.... – Moe Nov 07 '16 at 13:18

0 Answers0