Saturday 15 August 2015

linux - Python import nltk error -


I got an error like this when importing nltk via terminal

  [greenz @ Localhost hadoop] $ Python Python 2.6.6 (r266: 84292, 21 February 2013, 23:54:59) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] Type linux2 on "help", " Copyright "," "Credit" or "License" for more information & gt; & gt; Import nltk traceback (most recent call final): File "& lt; Stdin & gt; ", line 1, & lt; module & gt; file" /usr/lib/python2.6/site-packages/nltk/__init__.py ", line 73, & lt; modules & gt; internal import From the config_java file "/usr/lib/python2.6/site-packages/nltk/internals.py", line 10, in the & lt; module & gt; Import subprocess file "/usr/lib/python2.6/subprocess. Py ", line 425, & lt; module & gt; import pickle file" /usr/lib/python2.6/pickle.py ", line 165, & lt; module & gt; __all __ extension ((x [x] For the dir () in re.match ("[AZ] [A-Z0- 9 _] + $", x)]): Error: 'Module' object has no attribute 'match' & gt; & Gt; & gt;   

its equivalent Any ideas for paddy?

Could it be that you have 're.py' somewhere And any file of that?

Again in the module again match is by default, there is no such way which is unavailable.

You can get it through import re and print (re .__ file__)

No comments:

Post a Comment