2

I have original Python 2.7.5 in /usr/bin/python, and I installed Python3 by downloading Python 3.5.1 package in /usr/local/bin/python3, then I installed BeautifulSoup4 as below:

sudo easy_install BeautifulSoup4
Searching for BeautifulSoup4
Best match: beautifulsoup4 4.4.1
Processing beautifulsoup4-4.4.1-py2.7.egg
beautifulsoup4 4.4.1 is already the active version in easy-install.pth

Using /Library/Python/2.7/site-packages/beautifulsoup4-4.4.1-py2.7.egg
Processing dependencies for BeautifulSoup4
Finished processing dependencies for BeautifulSoup4

This way that I can't use bs4 in python3, how can I install bs4 on python3?

4

1 回答 1

7

您应该使用pip3可执行文件:

sudo pip3 install beautifulsoup4

如果您没有pip3安装:

curl bootstrap.pypa.io/get-pip.py | python3
于 2016-02-21T04:15:22.553 回答