简体   繁体   中英

How to install inltk in jupyter notebook?

While installing nltk I am facing this problem.

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

!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. To restart your kernel, click on Kernel>Restart . In general I would advise you to read an introduction to Jupyter notebooks to start .

!pip3 install nltk will do the job. The ! at the start, tells the notebook to run the succeeding statement as a shell command. You will see an output like this

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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