Title: jython support for nltk how to configure
Type: behaviour Severity: normal
Components: Library Versions: 2.5.0
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: amak Nosy List: amak, jimmycool
Priority: Keywords:

Created on 2012-03-06.04:25:49 by jimmycool, last changed 2012-03-29.18:38:42 by amak.

msg6789 (view) Author: shubhajoy das (jimmycool) Date: 2012-03-06.04:25:48
I want to know the method by which we can acces the nltk toolkit from 
jython,whenever i am trying to import nltk it says that the nltk module is not present
msg6821 (view) Author: Alan Kennedy (amak) Date: 2012-03-19.17:46:01
What is the name of the ntlk jar file?

Is the jar file on the classpath? What is your classpath setting?

What is the package name for NLTK? How are you trying to import into jython?
msg6913 (view) Author: shubhajoy das (jimmycool) Date: 2012-03-20.04:09:10
i am using netbeans ide as my development environment we can do
everything in netbeans except the nltk tool kit

The class path for the nltk package is
the classpath for the jython package
C:\Program Files\NetBeans 6.7.1\python1\jython-2.5\Lib
the classpath for the jython package
C:\Program Files\NetBeans 6.7.1\python1\jython-2.5\Lib\sitepackages

In the java path of my jython installation i have added the nltk jar file

The jython code gives error on importing nltk:
Traceback (most recent call last):
  File "C:\Documents and Settings\USER-1\My
line 9, in <module>
    from nltk import *
ImportError: No module named nltk

The jython code is
from javax.swing import *
from nltk import *
frame=JFrame("Hello Jython");
label=JLabel("Hello Jython!")

On 3/20/12, Alan Kennedy <> wrote:
> Changes by Alan Kennedy <>:
> ----------
> assignee:  -> amak
> _______________________________________
> Jython tracker <>
> <>
> _______________________________________
msg6932 (view) Author: Alan Kennedy (amak) Date: 2012-03-20.20:46:12
I'm not sure how netbeans sets up its classpath, but I recommend

A: Finding out what the classpath setting is when you run your programs under netbeans. You can do this by executing the following code in a jython program

>>> import java
>>> java.lang.System.getProperty("java.class.path")

B: Find out where the change the CLASSPATH setting in netbeans.

C: Add an entry in the CLASSPATH which points to your nltk.jar.
msg6979 (view) Author: Alan Kennedy (amak) Date: 2012-03-29.18:38:41
Closing this issue: It's really a "jython in netbeans" support question that belongs on the jython-users list, not a bug in jython.
Date User Action Args
2012-03-29 18:38:42amaksetstatus: open -> closed
resolution: works for me
messages: + msg6979
2012-03-20 20:46:12amaksetmessages: + msg6932
2012-03-20 04:09:10jimmycoolsetmessages: + msg6913
2012-03-19 21:57:16amaksetassignee: amak
2012-03-19 17:46:01amaksetnosy: + amak
messages: + msg6821
2012-03-06 04:25:49jimmycoolcreate