Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error installing NLTK Python

I am trying to install NLTK (https://pypi.python.org/pypi/nltk). I have Python 3.6 installed on my Windows 10 (64 bit) computer. When I run the NLTK installer, I get the following error:

"Python version -32 required, which was not found in the registry"

Does anyone have any experience with this or know how to resolve the error?

like image 892
jason Avatar asked Apr 16 '17 21:04

jason


3 Answers

Nltk itself is os independent, but the Windows msi installer is not, it's specifically for 32-bits pythons. Alternatively, you can use pip to install nltk, which will install the os independent source file. Simply in cmd, type this:

pip3 install nltk
# pip/pip3 doesn't matter only if there's multiple pythons, but if that does not work (command not found) type:
py -3 -m pip install nltk
like image 167
Taku Avatar answered Oct 22 '22 09:10

Taku


This works for me: py -m pip install nltk

like image 31
Priscilla Sim Avatar answered Oct 22 '22 11:10

Priscilla Sim


I found the issue and was able to solved my problem:

Windows 10 users with Python 64 bit might encounter a RuntimeError when trying to run import nltk. A recent Windows 10 update has a known bug when running the most recent version of NumPy 1.19.4 on the Python 64 bit version.

Solution: uninstall NumPy version 1.19.4 and reinstall 1.19.3.

From the command prompt:

pip uninstall numpy pip install numpy==1.19.3

If you are running a Mac and/or Python 32 bit the import nltk command should work fine.

For more information on the Windows bug: https://developercommunity.visualstudio.com/content/problem/1207405/fmod-after-an-update-to-windows-2004-is-causing-a.html

Best, Genie

like image 33
Genie Avatar answered Oct 22 '22 11:10

Genie