2014-08-30 12 views
5

Ich habe versucht, nltk unter Python 3.4 ohne Erfolg laufen zu lassen. Verwenden Sie die Anweisungen auf http://www.nltk.org/install.html: aberInstallation von nltk für Python 3.4 unter Mac OS 10.9

sudo pip installieren -U NLTK

Dies funktioniert für 2.7, die auf dem Mac vorinstalliert ist, wenn

sudo PIP3 mit installieren -U NLTK

zu versuchen und installieren Sie unter 3.4 bekomme ich folgende Fehlermeldung:

/usr/local/Cellar/python3/3.4.1_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'zip_safe' 

    warnings.warn(msg) 

/usr/local/Cellar/python3/3.4.1_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'test_suite' 

    warnings.warn(msg) 

/usr/local/Cellar/python3/3.4.1_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'entry_points' 

    warnings.warn(msg) 

usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] 

    or: setup.py --help [cmd1 cmd2 ...] 

    or: setup.py --help-commands 

    or: setup.py cmd --help 



error: invalid command 'bdist_egg' 

/private/tmp/pip_build_root/nltk/distribute-0.6.21-py3.4.egg 

Traceback (most recent call last): 

    File "/private/tmp/pip_build_root/nltk/distribute_setup.py", line 143, in use_setuptools 

    raise ImportError 

ImportError 



During handling of the above exception, another exception occurred: 



Traceback (most recent call last): 

    File "<string>", line 17, in <module> 

    File "/private/tmp/pip_build_root/nltk/setup.py", line 23, in <module> 

    distribute_setup.use_setuptools() 

    File "/private/tmp/pip_build_root/nltk/distribute_setup.py", line 145, in use_setuptools 

    return _do_download(version, download_base, to_dir, download_delay) 

    File "/private/tmp/pip_build_root/nltk/distribute_setup.py", line 125, in _do_download 

    _build_egg(egg, tarball, to_dir) 

    File "/private/tmp/pip_build_root/nltk/distribute_setup.py", line 116, in _build_egg 

    raise IOError('Could not build the egg.') 

OSError: Could not build the egg. 

Python 3.4 wurde mit brauen installiert und beide holprig und Setuptools ar e richtig installiert. Ich habe Hinweise auf dieses Problem durch einige glotzende, aber keine endgültigen Antworten gesehen.

Antwort

7

Ich habe gerade heruntergeladen die 3.0.0b2 .tar.gz Datei aus PyPI, dekomprimiert sie und lief in dem entpackten Verzeichnis

sudo python3 setup.py install 

und alles hat gut funktioniert. Ich hatte das gleiche Problem bei der Installation von pip3. Ich sollte auch beachten, dass ich MacPorts für Python und den ganzen Rest verwende, aber hoffentlich wird das keinen Unterschied machen.

+0

Während ich weiter dachte, versuchte ich das gleiche und es funktionierte auch. So das Ergebnis ist, dass die Nltk Docs und Pip-Methode scheint in diesem Fall gebrochen zu sein, aber nltk kann mit manuellem Download und Ausführen von setup.py installiert werden – ORG

Verwandte Themen