3

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?

1
  • 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 H Jun 23 '15 at 10:26
8

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
2
  • 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. – Swarup Rajbhandari Jun 23 '15 at 11:02
  • Good to hear. Now we go up a layer in the install stack. python-dev and python3-dev are ubuntu packages. – sbj3 Jun 23 '15 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.