I have Python 2.6.6 installed
I downloaded the textblob package from Here
I installed the package using the following command
python setup.py install
Inside my site-packages I can see the following egg
textblob-0.11.1-py2.6.egg
However when I am importing the package, it gives me the following error
> from textblob import TextBlob
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/textblob-0.11.1-py2.6.egg/textblob/__init__.py", line 9, in <module>
from .blob import TextBlob, Word, Sentence, Blobber, WordList
File "/usr/lib/python2.6/site-packages/textblob-0.11.1-py2.6.egg/textblob/blob.py", line 28, in <module>
import nltk
File "/usr/lib/python2.6/site-packages/nltk-3.2.1-py2.6.egg/nltk/__init__.py", line 114, in <module>
from nltk.collocations import *
File "/usr/lib/python2.6/site-packages/nltk-3.2.1-py2.6.egg/nltk/collocations.py", line 38, in <module>
from nltk.util import ngrams
File "/usr/lib/python2.6/site-packages/nltk-3.2.1-py2.6.egg/nltk/util.py", line 1361
d = {k: _default_to_regular(v) for k, v in d.items()}
^
SyntaxError: invalid syntax
Is there anything missing here?
UPDATE 1:
I installed successfully textblob 0.8.4
While installing NLTK 2.0.5, I am getting following error
command:
python setup.py install
Error:
`Installed /usr/lib/python2.6/site-packages/distribute-0.6.21-py2.6.egg
Traceback (most recent call last):
File "setup.py", line 69, in <module>
test_suite = 'nltk.test.simple',
File "/usr/lib64/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "build/bdist.linux-x86_64/egg/setuptools/command/install.py", line 73, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/install.py", line 101, in do_egg_install
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 345, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 565, in easy_install
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 617, in install_item
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 664, in process_distribution
TypeError: __init__() takes exactly 2 arguments (4 given)
`