我不知道如何在 Python 上安装 BeautifulSoup4。我已经下载了它,解压它并将它移动到用户目录。输入终端“cd beautifulsoup4-4.1.3”进入目录然后我输入“python setup.py install”然后我收到这条消息:
Adams-iMac:beautifulsoup4-4.1.3 adamparis$ python setup.py install
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/bs4
copying bs4/__init__.py -> build/lib/bs4
copying bs4/dammit.py -> build/lib/bs4
copying bs4/element.py -> build/lib/bs4
copying bs4/testing.py -> build/lib/bs4
creating build/lib/bs4/builder
copying bs4/builder/__init__.py -> build/lib/bs4/builder
copying bs4/builder/_html5lib.py -> build/lib/bs4/builder
copying bs4/builder/_htmlparser.py -> build/lib/bs4/builder
copying bs4/builder/_lxml.py -> build/lib/bs4/builder
creating build/lib/bs4/tests
copying bs4/tests/__init__.py -> build/lib/bs4/tests
copying bs4/tests/test_builder_registry.py -> build/lib/bs4/tests
copying bs4/tests/test_docs.py -> build/lib/bs4/tests
copying bs4/tests/test_html5lib.py -> build/lib/bs4/tests
copying bs4/tests/test_htmlparser.py -> build/lib/bs4/tests
copying bs4/tests/test_lxml.py -> build/lib/bs4/tests
copying bs4/tests/test_soup.py -> build/lib/bs4/tests
copying bs4/tests/test_tree.py -> build/lib/bs4/tests
running install_lib
creating /Library/Python/2.7/site-packages/bs4
error: could not create '/Library/Python/2.7/site-packages/bs4': Permission denied
Adams-iMac:beautifulsoup4-4.1.3 adamparis$
最后它说'权限被拒绝。为什么是这样?