I'm still super new to coding! Trying to learn from online tutorials, but I seem to be stuck on the first step! I think I installed bs4, but it's not showing up in python3, is it installed in the wrong place?
robbie$ sudo -H pip install bs4
Requirement already satisfied: bs4 in /Library/Python/2.7/site-packages
Requirement already satisfied: beautifulsoup4 in /Library/Python/2.7/site-packages (from bs4)
Robbies-MBP:~ robbie$ python3
Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import bs4
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'bs4'
Any help would be greatly appreciated :)
The Python "ModuleNotFoundError: No module named 'bs4'" occurs when we forget to install the beautifulsoup4 module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install beautifulsoup4 command.
Beautiful Soup is a Python library for pulling data out of HTML and XML files. It works with your favorite parser to provide idiomatic ways of navigating, searching, and modifying the parse tree. It commonly saves programmers hours or days of work.
To use beautiful soup, you need to install it: $ pip install beautifulsoup4 . Beautiful Soup also relies on a parser, the default is lxml . You may already have it, but you should check (open IDLE and attempt to import lxml). If not, do: $ pip install lxml or $ apt-get install python-lxml .
Requirement already satisfied: bs4 in /Library/Python/2.7/site-packages
Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04)
You have the module installed for Python 2.7, however you're using and trying to import
it with Python 3.6.
You have to use pip3
like you use python3
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With