一.问题描述
用python3写了个网页爬虫,使用到BeautifulSoup4模块,结果显示
> File "./title.py", line 7, in <module>
from bs4 import BeautifulSoup
ImportError: No module named 'bs4'
我使用下面的命令安装的啊,但是任然出现上面的问题
$ pip3 install BeautifulSoup4
二.解决办法
For python2.x:
$ sudo pip install BeautifulSoup4
# or
$ sudo pip install bs4
For python3.x:
$ sudo apt-get install python3-bs4
# or
$ sudo pip3 install bs4