0

ImportError: cannot import name add_metaclass

I'm getting this error. I'm using python27 and installed nltk and nltk_data, six but still the error is not solved. Please help.

Traceback (most recent call last):
  File "C:/Users/swati/PycharmProjects/finalproject/one.py", line 1, in <module>
    from nltk.stem import PorterStemmer
  File "C:\Python27\lib\site-packages\nltk\__init__.py", line 128, in <module>
    from nltk.chunk import *
 File "C:\Python27\lib\site-packages\nltk\chunk\__init__.py", line 157, in <module>
    from nltk.chunk.api import ChunkParserI
  File "C:\Python27\lib\site-packages\nltk\chunk\api.py", line 13, in <module>
    from nltk.parse import ParserI
  File "C:\Python27\lib\site-packages\nltk\parse\__init__.py", line 77, in <module>
    from nltk.parse.malt import MaltParser
  File "C:\Python27\lib\site-packages\nltk\parse\malt.py", line 14, in <module>
    from six import text_type
  File "C:\Users\swati\PycharmProjects\finalproject\six.py", line 2, in <module>
    from nltk.corpus import state_union
  File "C:\Python27\lib\site-packages\nltk\corpus\__init__.py", line 64, in <module>
    from nltk.tokenize import RegexpTokenizer
  File "C:\Python27\lib\site-packages\nltk\tokenize\__init__.py", line 64, in <module>
    from nltk.tokenize.mwe      import MWETokenizer
  File "C:\Python27\lib\site-packages\nltk\tokenize\mwe.py", line 33, in <module>
    from nltk.tokenize.api import TokenizerI
  File "C:\Python27\lib\site-packages\nltk\tokenize\api.py", line 14, in <module>
    from six import add_metaclass
ImportError: cannot import name add_metaclass

Process finished with exit code 1

Manfred Radlwimmer
  • 13,257
  • 13
  • 53
  • 62
swati
  • 11
  • 1
  • 3
  • What is the name of your python file that you're running from? – alvas May 08 '17 at 15:24
  • Please tell us what caused the error? Did it come from an import line? Or install command at pip? Or something else? – alvas May 08 '17 at 15:25
  • Also, welcome to StackOverflow! please take a look at https://stackoverflow.com/help/how-to-ask – alvas May 08 '17 at 15:26
  • i tried every solution which i get for this error in stack overflow but it was unsolved.. so finally i uninstall all the python and pycharm and then install it back.. now its working... – swati May 09 '17 at 06:04
  • i want to do text analytics on my own dataset.. will u plz give some tips to use csv file which has many columns.. how i can use my own dataset and how to do nltk- naïve baize classifier on that data, i have both training set and test set data.. i tried to create a "featuresets" but it's throwing error.. – swati May 09 '17 at 07:30
  • See http://stackoverflow.com/questions/29301952/testing-the-nltk-classifier-on-specific-file/29328362#29328362 – alvas May 09 '17 at 07:39

0 Answers0