简体   繁体   English

NLTK 数据下载在 Anaconda 环境中的 MacOS 上挂起

[英]NLTK data download hangs on MacOS in Anaconda environment

Running the following in a fresh jupyter notebook session or straight from the commandline:在新的jupyter notebook会话中或直接jupyter notebook运行以下命令:

import nltk
nltk.download()

freezes the MacOS login session and requires repeated login instead of popping up UI for choosing the data packages needed.冻结MacOS登录会话并需要重复登录而不是弹出用于选择所需数据包的UI。

Environment:环境:

  • miniconda install (anaconda 4.7.12; python 3.7.4.final). miniconda 安装(anaconda 4.7.12;python 3.7.4.final)。
  • NLTK v. 3.4.5 NLTK 诉 3.4.5
  • macOS Mojave v. 10.14.6 macOS Mojave v. 10.14.6
  • jupyter-core v. 4.6.1 jupyter 核心 v. 4.6.1
  • notebook v. 6.0.2笔记本 v. 6.0.2

How to workaround this?如何解决这个问题?

It seems that similar (however not as severe) problems led to the following question: nltk.download() hangs on OS X似乎类似(但不那么严重)的问题导致了以下问题: nltk.download() 在 OS X 上挂起

The solution was both in the above case and the referred case to use a shell download UI instead of graphical interface that nltk.download() is supposed to open:解决方案是在上述案例和参考案例中使用 shell 下载 UI 而不是nltk.download()应该打开的图形界面:

import nltk
nltk.download_shell()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM