jason
jason

Reputation: 3615

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?

Upvotes: 9

Views: 16144

Answers (4)

Code_Like_a_Newbie
Code_Like_a_Newbie

Reputation: 158

after running
py -m pip install nltk as suggested by Priscilla's comment above

I close my VS code and reopen it and everything is working !

Upvotes: 0

Genie
Genie

Reputation: 11

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

Upvotes: 1

Priscilla Sim
Priscilla Sim

Reputation: 21

This works for me: py -m pip install nltk

Upvotes: 2

Taku
Taku

Reputation: 33744

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

Upvotes: 10

Related Questions