0 votes
1 view
in Python by (11.8k points)

I attempted to install the nltk on the terminal I have python2.7 and I also installed python3.8 and java8 yet I got plenty of errors

Last login: Wed Sep 30 22:02:28 on console

[email protected] ~ % python -V

Python 2.7.16

[email protected] ~ % sudo apt update

Password:

Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk-15.jdk/Contents/Home/bin/apt" (-1)

[email protected] ~ % python3

Python 3.8.6 (v3.8.6:db455296be, Sep 23 2020, 13:31:39) 

[Clang 6.0 (clang-600.0.57)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import nltk

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

ModuleNotFoundError: No module named 'nltk'

>>> 

zsh: suspended  python3

[email protected] ~ % cd Desktop\python_Exercises

cd: no such file or directory: Desktoppython_Exercises

[email protected] ~ % cd Desktop/python_Exercises

cd: no such file or directory: Desktop/python_Exercises

[email protected] ~ % import sys

zsh: command not found: import

[email protected] ~ % pyhton3.8

zsh: command not found: pyhton3.8

[email protected] ~ % python3

Python 3.8.6 (v3.8.6:db455296be, Sep 23 2020, 13:31:39) 

[Clang 6.0 (clang-600.0.57)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> 

zsh: suspended  python3

[email protected] ~ % python --version

Python 2.7.16

[email protected] ~ % pip --version

pip 20.2.3 from /Library/Python/2.7/site-packages/pip-20.2.3-py2.7.egg/pip (python 2.7)

[email protected] ~ % python get-pip.py

/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'get-pip.py': [Errno 2] No such file or directory

[email protected] ~ % sudo apt install python3.8-pip

Password:

Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk-15.jdk/Contents/Home/bin/apt" (-1)

[email protected] ~ % 

1 Answer

0 votes
by (24.6k points)

Have you tried the following code?

import nltk

nltk.download()

This ought to raise a window to choose what you need to download from nltk

Want to learn python to get expertise in the concepts of python? Join python certification course and get certified

For more details, do check out the below video tutorial...

Related questions

0 votes
1 answer
0 votes
1 answer
asked Nov 27, 2020 in Python by bharathbk (280 points)
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...