9
pip install http://www.crummy.com/software/BeautifulSoup/unreleased/4.x/BeautifulSoup-4.0b.tar.gz
安裝包bs4,一切正常。但是,如果我加入這一行requirements.txt從網址pip安裝包
http://www.crummy.com/software/BeautifulSoup/unreleased/4.x/BeautifulSoup-4.0b.tar.gz
和運行
pip install -r requirements.txt
輸出
Downloading/unpacking http://www.crummy.com/software/BeautifulSoup/unreleased/4.x/BeautifulSoup-4.0b.tar.gz (from -r requirements.txt (line 40))
Downloading BeautifulSoup-4.0b.tar.gz (42Kb): 42Kb downloaded
Running setup.py egg_info for package from http://www.crummy.com/software/BeautifulSoup/unreleased/4.x/BeautifulSoup-4.0b.tar.gz
但包不會安裝。
>>> import bs4
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named bs4
很抱歉,但我不能重現這一點。適用於我。 – nisc
a)您是否嘗試過'導入BeautifulSoup'並且b)是否檢查過python路徑以查看BS是否實際安裝以及c)您是否使用virtualenv或類似的東西? –
它是作爲bs4包安裝的,因爲它是4.0版本。它在版本3.2中作爲BeautifulSoup導入。 –