Python Forum
ModuleNotFoundError: No module named 'http.client'; 'http' is not a package
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ModuleNotFoundError: No module named 'http.client'; 'http' is not a package
#1
i'm running this code
import requests
url="https://news.google.com/news/rss"
x=requests.get(url)
print(x)
and this error is occurred
Please help how to solve this

Error:
abhishek@localhost:~/visual studio$ python3 test3.py Traceback (most recent call last): File "test3.py", line 1, in <module> import requests File "/usr/lib/python3/dist-packages/requests/__init__.py", line 43, in <module> import urllib3 File "/usr/lib/python3/dist-packages/urllib3/__init__.py", line 7, in <module> from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 11, in <module> from .exceptions import ( File "/usr/lib/python3/dist-packages/urllib3/exceptions.py", line 2, in <module> from six.moves.http_client import IncompleteRead as httplib_IncompleteRead File "/usr/lib/python3/dist-packages/six.py", line 203, in load_module mod = mod._resolve() File "/usr/lib/python3/dist-packages/six.py", line 115, in _resolve return _import_module(self.mod) File "/usr/lib/python3/dist-packages/six.py", line 82, in _import_module __import__(name) File "/home/abhishek/visual studio/http.py", line 1, in <module> from http.client import HTTPConnection ModuleNotFoundError: No module named 'http.client'; 'http' is not a package
Please help
Reply
#2
you have a file named http.py at location home/abhishek/visual studio/
This file is interfering - rename it.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Triggering a ps1 script in remote windows server via http python request jasveerjassi 1 318 Jan-26-2024, 07:02 PM
Last Post: deanhystad
  no module named 'docx' when importing docx MaartenRo 1 709 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 22,945 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 2,164 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,312 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,390 Aug-07-2023, 05:32 AM
Last Post: DPaul
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 2 1,227 Jul-10-2023, 03:37 AM
Last Post: Wimpy_Wellington
  How to fix this error: ModuleNotFoundError: No module named 'notears' yaoyao22 2 963 Jul-09-2023, 11:24 AM
Last Post: yaoyao22
  Help with pyinstaller "No module named" korenron 9 8,208 Jun-15-2023, 12:20 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 934 May-15-2023, 02:38 PM
Last Post: tonynapoli2309

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020