Python Forum
[split] serious n00b.. NLTK in python 2.7 and 3.5
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] serious n00b.. NLTK in python 2.7 and 3.5
#4
Thanks for the responses! Sorry snippsat, will try to add more relevant info to future posts.

For background, I successfully followed all of the steps here to get Python3 setup: How To Install Python 3 and Set Up a Local Programming Environment on macOS. This included setting up an environment to manage python projects. Is pyenv a better way to do what they recommended in "Step 5 — Creating a Virtual Environment"?

@sparkz_alot - I tried
pip3 install nltk
and it seems to think the package is already there. When I fire up python3 and try to import nltk, it says it cannot find it.

I think I maybe installed nltk in an environment I had set up at the link below? I am just getting familiar with all this, so it's possible I implemented the environment but am failing to navigate it properly.

Kevins-MBP:~ kevin$ python3
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
Kevins-MBP:~ kevin$ pip3 install nltk
Requirement already satisfied: nltk in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: six in /usr/local/lib/python3.6/site-packages (from nltk)
Kevins-MBP:~ kevin$ python3
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] 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'
>>> 
Reply


Messages In This Thread
RE: [split] serious n00b.. NLTK in python 2.7 and 3.5 - by kevindenman - Feb-22-2018, 09:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error on trying to use NLTK Punkt PythonDE 1 2,080 Oct-22-2020, 07:17 PM
Last Post: PythonDE
  [nltk] Parsing with CFG constantin01 1 2,126 Jul-05-2019, 11:11 PM
Last Post: Larz60+
  [nltk] Relations Extractor constantin01 3 3,539 Jun-28-2019, 10:41 AM
Last Post: constantin01
  [nltk] Naive Bayes Classifier constantin01 0 2,014 Jun-24-2019, 10:36 AM
Last Post: constantin01
  NLTK Download Attribute error laila1a 1 8,631 Jan-27-2019, 12:03 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020