Command Line imports nltk, but Python/Idle won't :( (mac)

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Nimic86

Thread Starter
Joined
Sep 4, 2017
Messages
1
Whenever I use the command, import nltk (Natural Language Toolkit) from the shell, it works and imports nltk as expected.

When I try to do so from Python however, I get the following error message:

Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import nltk
ImportError: No module named nltk

I vaguely know it's a "PATH" error, but nothing online has been able to help me, since they always use example paths which aren't my exact match, and I end up very lost.

Here's this too, if it helps at all:
>>> import sys
>>> sys.path
['', '/Users/bobbybermudez/Documents', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages']

I don't see 'nltk' anywhere up there, which from what I've gathered online is bad?

Would greatly appreciate any help. Thanks :)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top