简体   繁体   English

如何在 jupyter notebook 中安装 inltk?

[英]How to install inltk in jupyter notebook?

While installing nltk I am facing this problem.安装nltk时我遇到了这个问题。

Note: you may need to restart the kernel to use updated packages.

And here is the image这是图像

You should either use a !您应该使用! in front of your bash installation instructions like this在你的 bash 前面安装说明是这样的

!pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html

Or do it in a terminal window by clicking on File>New>Terminal and install the packages from there.或者在终端 window 中单击文件>新建>终端并从那里安装软件包。 To restart your kernel, click on Kernel>Restart .要重新启动您的 kernel,请单击Kernel>Restart In general I would advise you to read an introduction to Jupyter notebooks to start .一般来说,我会建议您先阅读Jupyter notebooks 简介

!pip3 install nltk will do the job. !pip3 install nltk将完成这项工作。 The !! at the start, tells the notebook to run the succeeding statement as a shell command.一开始,告诉笔记本将后续语句作为 shell 命令运行。 You will see an output like this你会看到这样的 output

Collecting nltk
  Downloading https://files.pythonhosted.org/packages/f6/1d/d925cfb4f324ede997f6d47bea4d9babba51b49e87a767c170b77005889d/nltk-3.4.5.zip (1.5MB)
    100% |████████████████████████████████| 1.5MB 873kB/s ta 0:00:01
Collecting six (from nltk)
  Using cached https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Building wheels for collected packages: nltk
  Running setup.py bdist_wheel for nltk ... done
  Stored in directory: /home/swati/.cache/pip/wheels/96/86/f6/68ab24c23f207c0077381a5e3904b2815136b879538a24b483
Successfully built nltk
Installing collected packages: six, nltk
Successfully installed nltk-3.4.5 six-1.14.0

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

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