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

前端 未结 5 1428
春和景丽
春和景丽 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条回答
  •  遥遥无期
    2021-02-07 15:21

    I have often referenced the documentation link: https://docs.python.org/3/installing/

    Some examples:

     python2   -m pip install SomePackage  # default Python 2 
     python2.7 -m pip install SomePackage  # specifically Python 2.7 
     python3   -m pip install SomePackage  # default Python 3 
     python3.4 -m pip install SomePackage  # specifically Python 3.4
    

提交回复
热议问题