1. Can go directly to the official website NLTK:HTTPS://PYPI.PYTHON.ORG/PYPI/NLTK download installation package directly to install the configuration
2.NLTK 3.2.2 Required version is Python 2.7 or 3.4+
There may be an error when installing directly using the installation package on the official website, for example, I encountered Python-32 was Required,which is not found in registry.
Possible causes:
1.Python version not correct
2. Incorrect registry information, Python not joined the registry
To resolve this situation, you can use the Create script file to establish the registration information. (The code is appended to the end of the article), and then run the script, and then run the installation after it has been successfully added.
PS: You can also use the PIP for a quick installation.
Python3.0 with the pip above, to keep the library up to date, you can update the PIP before you install NLTK.
Update pip:python-m PIP install-u pip
Install nltk:python-m pip Install NLTK
After a successful installation, you can install the data directly.
#===========================register.py=======================================## #!/usr/bin/env Python #-*-coding : utf-8-*-Import sys from winreg import * # tweak as necessary version = Sys.version[:3] InstallPath = Sys.prefix Regpa th = "software\\python\\pythoncore\\%s\\"% (version) Installkey = "InstallPath" Pythonkey = "Pythonpath" Pythonpath = "%s" ;%s\\lib\\;%s\\dlls\\ "% (InstallPath, InstallPath, InstallPath) def registerpy (): Try:reg = Open Key (HKEY_CURRENT_USER, Regpath) except environmenterror as E:try:reg = CreateKey (hkey_current_us ER, Regpath) SetValue (Reg, Installkey, REG_SZ, InstallPath) SetValue (Reg, Pythonkey, REG_SZ, Pytho
Npath) Closekey (reg) Except:print ("* * Unable to register!")
return print ("---Python", version, "are now registered!") return if (QueryValue (Reg, installkey) = = InstallPath and QueryValue (Reg, PythonkEY) = = Pythonpath): Closekey (reg) print ("= = = Python", version, "is already registered!")
Return Closekey (reg) Print ("* * Unable to register!")
Print ("* * * you probably have another Python installation!") Registerpy ()