NLTK, installed in python 2.7 but not working in python 3.4
9,463
Python 2 and Python 3 have different sets of installed packages.
I just installed nltk on both and am able to import in both.
pip2 install nltk
pip3 install nltk
Related videos on Youtube
Comments
-
Swarup Rajbhandari over 1 year
I just installed nltk when my default python was the 2.7 version, now when I open the python3 (3.4 version), I can't import nltk, is there any solution to this, to make nltk available for both versions?
-
Carl H almost 9 yearsPython2 and Python3 should be regarded as two completely seperate packages. Installing a module for one does not install it for the other - if you need the same module available for both Py2 and Py3, then install it for both.
-
-
Swarup Rajbhandari almost 9 yearsthanks, now its working, but now i have a problem with "numpy", when i am installing it, it shows that i have to install python-dev, and i installed it with python2 ,and so upgrading python dev is a no progress, "0 downloaded, 0 upgraded". and still i cant install numpy.
-
sbj3 almost 9 yearsGood to hear. Now we go up a layer in the install stack. python-dev and python3-dev are ubuntu packages.