即使将其安装在我的计算机上,也可以导入nltk

发布于 2025-01-31 06:41:20 字数 461 浏览 1 评论 0 原文

当我打开Jupyter笔记本并尝试导入NLTK时,错误。我可以导入其他软件包,但是我不能导入NLTK

,我将在下面添加屏幕截图以说明所有这些内容,但是

  • 我在Mac上使用 pip3 install nltk 在我的Mac上安装了NLTK,
  • 我可以运行 pip show nltk 要查看成功的安装,
  • 我无法在jupyter笔记本电脑中导入NLTK,或者通过在Python终端中运行它,
  • 我不使用任何环境或Conda环境,
  • 我正在使用Python 3.9.6

When I open a jupyter notebook and try to import NLTK it errors. I can import other packages but I cannot import NLTK

I'll add a screenshot below to illustrate all of this but

  • I installed nltk with pip3 install nltk on my mac
  • I can run pip show nltk to see the successful installation
  • I can't import nltk in jupyter notebooks or by running it in the python terminal
  • I am not using any environments or conda environments
  • I am using python 3.9.6

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

和影子一齐双人舞 2025-02-07 06:41:20
import nltk
nltk.download()

您的python安装和ipython是分开的。

import nltk
nltk.download()

your python installations and your ipython are separate.

秋凉 2025-02-07 06:41:20

您好,

如果您运行 Mac/unix

install nltk:运行PIP install -user -u nltk

innempy numpy(可选):运行pip install -user -user -u numpy

test安装:运行python然后键入导入nltk

python版本可能有必要安装setuptools(请参阅 https://pypi.python.org/pypi/setuptools )和安装PIP(sudo easy_install pip)。

Windows

这些说明假设您在计算机上尚未安装Python。

32位二进制安装
安装python 3.8: https://www.pypython.org/downloads/ 位版本)

安装numpy(可选): https://www.scipy.org/scipy.org/scipylib/scipylib/scipylib/scipylib/downloadload 。

​a>

测试安装:start> python38,然后键入 import nltk

,如果它不起作用,请使用conda安装nltk by:

conda install -c anaconda nltk

以获取更多信息检查:
https://www.nltk.org/install.install.html

Hello,

if you run Mac/Unix

Install NLTK: run pip install --user -U nltk

Install Numpy (optional): run pip install --user -U numpy

Test installation: run python then type import nltk

For older versions of Python it might be necessary to install setuptools (see https://pypi.python.org/pypi/setuptools) and to install pip (sudo easy_install pip).

Windows

These instructions assume that you do not already have Python installed on your machine.

32-bit binary installation
Install Python 3.8: https://www.python.org/downloads/ (avoid the 64-bit versions)

Install Numpy (optional): https://www.scipy.org/scipylib/download.html

Install NLTK: https://pypi.python.org/pypi/nltk

Test installation: Start>Python38, then type import nltk

And if it doesnt work, install nltk using Conda By :

conda install -c anaconda nltk

For more info check :
https://www.nltk.org/install.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文