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
  Using moviepy fails due to "ModuleNotFoundError: No module named 'pip._internal.utils sheepog 2 2,272 May-28-2025, 06:57 PM
Last Post: sheepog
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 3 5,037 May-10-2025, 05:56 PM
Last Post: Wimpy_Wellington
  MPEG DASH Package implementation similar to M3U8 package anantha_narayanan 1 2,038 May-05-2025, 08:34 AM
Last Post: pintailscratchy
  ModuleNotFoundError: No module named 'tkcalendar', Thonny, Windows 10 Edward_ 4 5,379 Apr-06-2025, 07:56 PM
Last Post: Edward_
  No module named 'importlib.metadata' EdVS 3 3,055 Jan-30-2025, 09:55 AM
Last Post: Larz60+
  client A to server B connects but client B to server A doesnt connect gerald 1 1,483 Aug-17-2024, 07:33 AM
Last Post: Gribouillis
  ModuleNotFoundError: No module named 'athena_read' raman 2 2,311 Jul-01-2024, 07:52 AM
Last Post: Gribouillis
  Triggering a ps1 script in remote windows server via http python request jasveerjassi 1 1,550 Jan-26-2024, 07:02 PM
Last Post: deanhystad
  no module named 'docx' when importing docx MaartenRo 1 8,961 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 34,935 Nov-02-2023, 08:20 AM
Last Post: South_east

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020
This forum uses Lukasz Tkacz MyBB addons.
Forum use Krzysztof "Supryk" Supryczynski addons.