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 bs4
error 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;
Similar Posts:
- Importerror: no module named BS4 error resolution
- ImportError: No module named ‘requests’
- modulenotfounderror: no module named ‘cv2’ [How to Solve]
- ImportError: No module named pkg_resources [How to Solve]
- After installing BS4 in Python, pychar still reports module not found error: no module named ‘BS4’
- Importerror: no module named yaml solution [How to Solve]
- How to Solve Beautifulsoup Error: “No module named ‘bs4’.” [from bs4 import BeautifulSoup]
- [Solved] ImportError: No module named tensorflow
- How to Solve Centos Yum Error: No module named yum
- Python ImportError: No module named win32com.client [How to Solve]