Priyanshu Kedia
Priyanshu Kedia

Reputation: 21

nltk module installation in pip through cmd

When I tried to run this command:

c:\python27\scripts\pip install nltk-3.2.1-py2.py3-none-any

I am getting the error:

no matching distribution found 
Although i have installed nltk from 
http://www.lfd.uci.edu/~gohlke/pythonlibs/#nltk 

Kindly help.

I am working on Windows 8 64-bit Version

Upvotes: 0

Views: 9124

Answers (2)

Sandeep Anand
Sandeep Anand

Reputation: 436

Try Anaconda - Instead . Always works

C:\Users\sanan>conda install -c anaconda nltk Fetching package metadata ............. Solving package specifications: .

Package plan for installation in environment C:\Users\sanan\Miniconda3:

The following NEW packages will be INSTALLED:

nltk:      3.2.4-py36_0  anaconda

The following packages will be UPDATED:

conda:     4.3.23-py36_0          --> 4.3.25-py36_0 anaconda

The following packages will be SUPERSEDED by a higher-priority channel:

conda-env: 2.6.0-0                --> 2.6.0-0       anaconda

Proceed ([y]/n)? y

conda-env-2.6. 100% |###############################| Time: 0:00:00 22.84 kB/s nltk-3.2.4-py3 100% |###############################| Time: 0:00:02 774.24 kB/s conda-4.3.25-p 100% |###############################| Time: 0:00:00 578.90 kB/s

After installation is complete .

import nltk
print(nltk.__version__)

C:\Public\Code\textnorm>python attempt1.py 3.2.4

Upvotes: 0

Ic3fr0g
Ic3fr0g

Reputation: 1219

Installing new modules can be a nightmare if you are new to Python.First delete any old versions of NLTK if already installed. Open cmd navigate to C:\Users\user\AppData\Local\Programs\Python\Python35-32\Scripts, the default directory, using the command cd path_name_comes_here. Otherwise goto the path where you have installed python and goto the Scripts subfolder and use this path here onwards. Now the most preferred way is to use pip install module_you_want_to_install for anything in python. Pip automatically fetches everything it needs to install said module.

  • Simply use pip install nltk.
  • Another method is to use easy_install requirement_or_URL.
  • Some rare occasions its best to download the wheel from http://www.lfd.uci.edu/~gohlke/pythonlibs and from there you can simply use pip install downloaded_wheel_name again. But make sure to copy the name of the wheel EXACTLY.

Post installation make sure that your package is accessible from C:\Users\user\AppData\Local\Programs\Python\Python35-32\Lib\site-packages or a similar path depending on where you installed python.

Upvotes: 1

Related Questions