Tag Archives: ImportError: No module named bs4

Importerror: no module named BS4 error resolution

How is 618 sales champion made?Uncover the secret of e-commerce’s “invigorating” hundreds of millions of sales data>>>

Preface: in my graduation thesis, I plan to use Python as a crawler to crawl some data, and I started to learn Python recently

I encountered a problem in my study. I installed Python according to the article I read, configured the corresponding environment (using the window system), and used the pychar editor to write python (this software is very convenient to run python, and the library needed to install Python is also very simple)

After installing the two libraries of requests and beautifulsoup, we start to crawl a local HTML. At the beginning, we refer to from BS4 import beautifulsoup, but at the end, we always report importerror: no module named BS4 error

After checking some information, the problem was solved successfully

Solution:

The runtime prompts importerror: no module named BS4 error, which means that the module named beautifulsoup4 was not found

Write about how Python installs modules:

1. Download BS4 module:

http://www.crummy.com/software/BeautifulSoup/bs4/download/4.3/beautifulsoup4-4.3.2.tar.gz

2. Unzip to the root directory under the python installation directory:

3. Run CMD and enter the directory after decompression (if Python is installed on Disk C by default, after opening CMD, you can use CD… Statement to return to the root directory first, and then enter into python27/beautiful soup4-4.3.2)

4. Install BS4 module after entering python27/beautiful soup4-4.3.2

After installation, it can be used;

Importerror: no module named BS4 error resolution

Preface: Graduation thesis plans to use Python as a crawler to crawl some data, and recently started to get started with Python;

I encountered a problem while studying. I installed Python according to the article I read, and configured the corresponding environment (using the window system), and used the pycharm editor to write Python (this software is very convenient to run Python, and install the libraries needed for Python. It’s also very simple).

After installing the requests and BeautifulSoup libraries, I started to crawl a local html. At the beginning, I quoted from bs4 import BeautifulSoup, but I kept reporting ImportError: No module named bs4 at the end ;

 

After checking some information, the problem was solved smoothly;

Solution:

An ImportError: No module named bs4error is displayed during runtime , meaning that the module named Beautifulsoup4 was not found.

Write about how Python installs modules:

1. Download the BS4 module:

http:/ /www.crummy.com/software /BeautifulSoup/bs4/download/ 4.3/beautifulsoup4- 4.3. 2.tar.gz

2. Unzip it to the root directory under the Python installation directory:

3. Run cmd and enter the decompressed directory (if Python is installed in the C drive by default, after opening cmd, you can use the cd … statement to return to the root directory first, and then enter Python27\beautifulsoup4-4.3.2 )

4. After entering Python27\beautifulsoup4-4.3.2 , install the BS4 module:

 

It can be used after installation;