简体   繁体   中英

Can't import Beautiful Soup in Python 3.6

I'am using Ubuntu and I just used apt to install Beautiful Soup by running the command sudo apt-get install python3-bs4 . Runnig apt list --installed | grep bs4 apt list --installed | grep bs4 gives the following output:

python3-bs4/xenial,xenial,now 4.4.1-1 all [installed]

In spite of this I can't import bs4. Here's the code and the error associated with it:

>>> from bs4 import BeautifulSoup
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'bs4'

您可能需要将Beautiful Soup 4安装到虚拟环境中。

pip install beautifulsoup4

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM