Ich habe nltk und nltk-data installiert. Programm gibt Fehler auf import nltk
.Importfehler beim Import von nltk (kann bracket_parse nicht importieren)
Im Folgenden finden Sie Fehler-Stack-Trace:
import nltk
File "/usr/local/lib/python2.7/dist-packages/nltk/__init__.py", line 137, in <module>
from nltk.stem import *
File "/usr/local/lib/python2.7/dist-packages/nltk/stem/__init__.py", line 29, in <module>
from nltk.stem.snowball import SnowballStemmer
File "/usr/local/lib/python2.7/dist-packages/nltk/stem/snowball.py", line 24, in <module>
from nltk.corpus import stopwords
File "/usr/local/lib/python2.7/dist-packages/nltk/corpus/__init__.py", line 66, in <module>
from nltk.corpus.reader import *
File "/usr/local/lib/python2.7/dist-packages/nltk/corpus/reader/__init__.py", line 109, in <module>
from nltk.corpus.reader import bracket_parse
ImportError: cannot import name bracket_parse
Vielen Dank im Voraus
Wie haben Sie NLTK installiert? – Samuel
Ich habe nltk mit sudo pip install -U nltk installiert. Es funktionierte ursprünglich ich hatte installiert sklearn von pip install -U scikit-lernen zusammen mit scipy und npmpy Ich bin nicht in der Lage, herauszufinden, was falsch ist –
Es kann Konflikte mit Dateinamen in Ihrem Projekt. Überprüfen Sie die Dateinamen des Projekts – Samuel