2017-07-17 4 views
1

Ich installiere Python Zeitung Bibliothek mit dem folgenden Befehl in einer virtuellen Umgebung:Problem mit der Installation von Python Zeitung Paket

pip install newspaper 

Ich erhalte die folgende Fehlermeldung. Es existiert noch, nachdem ich einige Lösungen von StackOverflow ausprobiert habe, aber es hat nicht funktioniert. Ich hatte das gleiche Problem, vor dem ich mit der Installation einer bestimmten Version (und Aktualisierung) von Setup-Tools (andere Maschine) gelöst. Allerdings funktioniert es hier nicht.

Irgendwelche Ideen was mache ich falsch? Was bedeutet dieser Fehler eigentlich?

IDE: PyCharm mit einer virtuellen Umgebung, Python 2.7 auf Ubuntu

Fehler:

File "/tmp/tmp4L5_rz/distribute-0.6.21/pkg_resources.py", line 2229, in activate 
     self.insert_on(path) 
     File "/tmp/tmp4L5_rz/distribute-0.6.21/pkg_resources.py", line 2330, in insert_on 
     "with distribute. Found one at %s" % str(self.location)) 
    ValueError: A 0.7-series setuptools cannot be installed with distribute. Found one at /usr/lib/python2.7/dist-packages 
    /tmp/pip-build-LTk2i0/nltk/distribute-0.6.21-py2.7.egg 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "/tmp/pip-build-LTk2i0/nltk/setup.py", line 23, in <module> 
     distribute_setup.use_setuptools() 
     File "/tmp/pip-build-LTk2i0/nltk/distribute_setup.py", line 145, in use_setuptools 
     return _do_download(version, download_base, to_dir, download_delay) 
     File "/tmp/pip-build-LTk2i0/nltk/distribute_setup.py", line 125, in _do_download 
     _build_egg(egg, tarball, to_dir) 
     File "/tmp/pip-build-LTk2i0/nltk/distribute_setup.py", line 116, in _build_egg 
     raise IOError('Could not build the egg.') 
    IOError: Could not build the egg. 

    ---------------------------------------- 
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-LTk2i0/nltk/ 

Antwort

0

auf Github Dokumentationsseite der Zeitung zufolge haben sie die Python 2-Version des API veraltet und habe es als Buggy bezeichnet. Die genaue Aussage wie folgt:

"Newspaper is a Python3 library! Or, view our deprecated and buggy Python2 branch" 

Referenz: https://github.com/codelucas/newspaper

Es zeigt, dass wir nicht die Python-2-Version nicht mehr verwendet werden soll.

Im Moment bin ich für diesen speziellen Anwendungsfall zu Python 3 gewechselt.

0

Versuchen neu installieren Setuptools

pip install --upgrade setuptools 

wenn nicht umgehen, entfernen Sie verteilen:

rm -fr /usr/local/lib/python2.7/dist-packages/distribute* 
+0

Bereits versucht, dass. Es hat nicht funktioniert. – utengr

+0

Sie verwenden Linux oder Windows? –

+0

Ich arbeite in Ubuntu. – utengr

-2

kann bestätigen, dass diese

pip --upgrade Setuptools installieren

das Installationsproblem auf EC2 geklärt

Verwandte Themen