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?
-
Python2 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.– Carl HJun 23, 2015 at 10:26
1 Answer
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
-
thanks, 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. Jun 23, 2015 at 11:02
-
Good to hear. Now we go up a layer in the install stack. python-dev and python3-dev are ubuntu packages.– sbj3Jun 23, 2015 at 14:00