Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install Beautifulsoup ("bs4 does not exist")

I'm struggling to get BeautifulSoup installed on Windows. So far, I have:

  1. downloaded BeautifulSoup to "My Downloads".

  2. unzipped/ extracted it in the downloads folder.

  3. At the command prompt, I ran:

    C:<path to python33> "C:path to beautiful soup\setup.py" install
    

The process generated the messages:

running install
running build
running build_py
**error: package directory 'bs4' does not exist.**

Yet, in the path to BeautifulSoup in quotes above, there is indeed the folder bs4. What am I missing?

like image 419
StatsViaCsh Avatar asked Jul 12 '13 15:07

StatsViaCsh


People also ask

Is bs4 same as BeautifulSoup?

As BeautifulSoup is not a standard python library, we need to install it first. We are going to install the BeautifulSoup 4 library (also known as BS4), which is the latest one.

What is bs4 in BeautifulSoup in Python?

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.

How do you fix ModuleNotFoundError No module named bs4?

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.


2 Answers

You need to be in the directory containing setup.py to run it. Make sure your working directory is correct.

like image 72
Chris Morgan Avatar answered Sep 22 '22 22:09

Chris Morgan


I had a similar problem. In my case, I was able to get pip to work, but first I had to look up the right name for the package:

wrong: pip install bs4

fail

wrong: pip install beautifulsoup

fail

right: pip install beautifulsoup4

Successfully installed beautifulsoup4

like image 43
szeitlin Avatar answered Sep 24 '22 22:09

szeitlin