看来这是PyInstaller
for的钩子的已知错误
nltk。解决此问题的一种简单方法是编辑此文件:
<PythonPath>/Lib/site-packages/PyInstaller/hooks/hook-nltk.py
并注释重复的行
nltk_data:
#-----------------------------------------------------------------------------# Copyright (c) 2005-2018, PyInstaller Development Team.## Distributed under the terms of the GNU General Public License with exception# for distributing bootloader.## The full license is in the file COPYING.txt, distributed with this software.#-----------------------------------------------------------------------------# hook for nltkimport nltkfrom PyInstaller.utils.hooks import collect_data_files# add datas for nltkdatas = collect_data_files('nltk', False)# loop through the data directories and add them# for p in nltk.data.path:# datas.append((p, "nltk_data"))datas.append(("<path_to_nltk_data>", "nltk_data"))# nltk.chunk.named_entity should be includedhiddenimports = ["nltk.chunk.named_entity"]请记住用替换
path_to_nltk_data您当前的路径
nltk_data。



