Ubuntu - How to install a Python module (BeautifulSoup) on Python 3.3 instead of Python 2.7?

前端 未结 5 1446
春和景丽
春和景丽 2021-02-07 14:36

I have this code (as written in BS4 documentaion):

  from bs4 import BeautifulSoup

When I run the script (using python3) I get the error:

5条回答
  •  旧时难觅i
    2021-02-07 15:20

    A single command did the trick for me:

    Try:

    sudo apt-get install python3-bs4
    

    and then import it as:

    from bs4 import BeautifulSoup    
    

提交回复
热议问题