Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 如何在Mac上将BeautifulSoup4安装到python3_Python 2.7_Python 3.x_Beautifulsoup_Bs4 - Fatal编程技术网

Python 2.7 如何在Mac上将BeautifulSoup4安装到python3

Python 2.7 如何在Mac上将BeautifulSoup4安装到python3,python-2.7,python-3.x,beautifulsoup,bs4,Python 2.7,Python 3.x,Beautifulsoup,Bs4,我在/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

我在/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

伟大的我刚试过pip,但没有pip,应该是pip3!