python-2.7 - 如何在Mac上安装BeautifulSoup4到python3

标签 python-2.7 python-3.x beautifulsoup

我在/usr/bin/python中有原始的Python 2.7.5,我通过在/usr/local/bin/python3中下载Python 3.5.1包安装了Python3,然后我安装了BeautifulSoup4,如下所示:

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

这样我就无法在python3中使用bs4了,如何在python3上安装bs4呢?

最佳答案

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

sudo pip3 install beautifulsoup4
<小时/>

如果您没有安装pip3:

curl bootstrap.pypa.io/get-pip.py | python3

关于python-2.7 - 如何在Mac上安装BeautifulSoup4到python3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35532234/

相关文章:

Python Bot 按顺序发送消息

python - 提取多个 URL - Python

python - BeautifulSoup 导入错误

python - BeautifulSoup4 无法正常工作,即使我已经使用 pip Linux Mint Sarah 成功安装了它

python-2.7 - 即使使用最新的 ssl,也无法在 Appengine 开发服务器上调用 Stripe

python - Python 中 % 的结果是什么?

删除单字符串的 MySql

python-2.7 - 我应该在哪里安装 CMake?

python - 如何通过分区连接 Pandas 列?

python - 如何找到特定 <ul> 类中的所有 <li>?