2011-10-14 6 views
9
pip install http://www.crummy.com/software/BeautifulSoup/unreleased/4.x/BeautifulSoup-4.0b.tar.gz 

questo installa il pacchetto bs4 e tutto è ok. Ma se posso aggiungere questa linea al requirements.txtpacchetto di installazione pip dall'URL

http://www.crummy.com/software/BeautifulSoup/unreleased/4.x/BeautifulSoup-4.0b.tar.gz 

ed eseguire

pip install -r requirements.txt 

l'uscita è

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 

ma il pacchetto non viene installato.

>>> import bs4 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named bs4 
+3

Ci dispiace, ma non posso riproduci questo Per me va bene. – nisc

+0

a) hai provato 'import BeautifulSoup' e b) hai controllato il percorso Python per vedere se BS è stato effettivamente installato e c) stai usando virtualenv o qualcosa del genere? –

+0

è installato come pacchetto bs4, poiché è una versione 4.0. È importato come BeautifulSoup nella versione 3.2 –

risposta

3

Si noti che questo può accadere se si dispone di più di un interprete installato e pip sta usando uno (per esempio, 2.6) e il vostro python shell un altro (ad esempio, 2.7)