Skip to content
Advertisement

Using Pyinstaller with NLTK results in error: can’t find nltk_data

I am attempting to export a simple GUI that used NLTK as an exe with Python 3.6 and Windows 10.

When I run PyInstaller to freeze my simple program as an exe I get the error: Unable to find “c:usersusrnltk_data” when adding binary and data files.

When I even copied the nltk_data folder here and I get an error in a different nltk.data.path path “c:usersusrappdatalocalprogramspythonpython36nltk_data”

JavaScript

for pyinstaller I run

JavaScript

Advertisement

Answer

It seems that it is a known bug to the hook of PyInstaller named nltk. An easy way to fix it is to edit this file:

JavaScript

And comment the lines iterating over nltk_data:

JavaScript

Remember to replace path_to_nltk_data with your currrent path for nltk_data.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement