how to solve "ModuleNotFoundError: No module named 'beautifulsoup4'"? - python

I'm work in Python Idle.
I installed BeautifulSoup4 with "pip install beautifulsoup4" in Powershell, and it works in Powershell's python.
But when I run in Python Idle
# Read Library
from bs4 import BeautifulSoup
error message said
Traceback (most recent call last):
File "C:/Users/umts1202/Desktop/ML/bs-test1.py", line 2, in <module>
from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'
I have no idea what to do. Please help me :(

Related

BS4 module not found

Traceback (most recent call last):
File "d:/project.py", line 2, in <module>
from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'
Guys any idea why i get this error.
Ive installed bs4 with cmd and pip
Where do i have to install the module i am really confused
Some of them work and some of them dont
For example, bs4 doesnt but tkinter does

Requests module not found

I'm trying to run my python code with the the requests module.
This is the code I use:
import requests
res = requests.get("https://www.goodreads.com/book/review_counts.json", params={"key": "rhcFvMg9fxSBPoN4TCb7hQ", "isbns": "9781632168146"})
print(res.json())
The following is the error that shows up:
Traceback (most recent call last):
File "/Users/jonathankent/Downloads/project1/test.py", line 1, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
If anyone knows what could be causing this or what I could do to solve it I would be very appreciative.
requests module is not part of python built-in libraries so you have to install it yourself from the command line using pip:
pip install requests
if you are on MacOS try pip3 install requests

Python - ModuleNotFoundError: No module named 'pyown'

so i'm making my first telegram bot, and when compiling code in ConEmu I got this error:
Traceback (most recent call last):
File "echobot.py", line 1, in <module>
import pyown
ModuleNotFoundError: No module named 'pyown'
help me please.
import pyown
ModuleNotFoundError: No module named 'pyown'
Are you sure that the library is called pyown, not pyowm?
https://pypi.org/project/pyowm/
It can't find pyown library. Install this library first, either to your working folder's library folder or install it globally. Then import pyown library on your py file. Then write rest of the codes.

ModuleNotFoundError: No module named 'bs4' when running a script using the run command

I'm trying to learn webscraping and when running a script using the run command on Windows, it shows an error in cmd:
Traceback (most recent call last):
File "c:\users\user\MyPythonScripts\k.py", line 1, in <module>
import bs4, requests
ModuleNotFoundError: No module named 'bs4'
It only happens using the run command, the script fine on the PyCharm IDE though.

Selenium - no module named http.client

I just installed Selenium (from source) for Python 2.7.
When I try to import selenium, I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\selenium-2.25.0-py2.7.egg\selenium\__init__.py", line 16, in <module>
from .selenium import selenium
File "C:\Python27\lib\site-packages\selenium-2.25.0-py2.7.egg\selenium\selenium.py", line 19, in <module>
import http.client
ImportError: No module named http.client
What could be causing this? If I remember correctly, http.client is a python 3 module. Why is selenium trying to import it?
Thanks to the help of DSM, I figured it out. Because I had previously ran setup.py with a python3 executable by accident, the selenium build folder was populated with 2to3 converted code. When I later ran python27 setup.py install it ended up using the same build folder for the installation without overwriting its content. I ended up deleting the build folder and trying again, and it works.

Categories

Resources