How to install beautifulsoup into python3, when default dir is python2.7?

前端 未结 5 1187
面向向阳花
面向向阳花 2021-02-05 04:21

I have both Python 2.7 and Python 3.5 installed. When I type pip install beautifulsoup4 it tells me that it is already installed in python2.7/site-package directory

5条回答
  •  自闭症患者
    2021-02-05 05:06

    Run as root:

    apt-get install python3-bs4
    #or
    pip3 install beautifulsoup4
    

    Afterwards import it like this:

    import bs4
    

提交回复
热议问题