This project has moved. For the latest updates, please go here.
1

Closed

DUPLICATE: IronPython not compatible with NLTK

description

----------------------------------------------------------------------------------------------------

IP VERSION AFFECTED: 2.6, 2.0.2
BUILD TYPE: Beta (2.6) and Release (2.0.2)
FLAGS PASSED TO IPY.EXE: None
OPERATING SYSTEM: 32-bit Vista SP2
CLR VERSION: .NET 2.0 SP1
SCENARIOS AFFECTED:

----------------------------------------------------------------------------------------------------

BRIEF DESCRIPTION:
 
The Python Natural Language Toolkit (NLTK) does not seem to work with IronPython.
 
After installing NLTK, I get this error message when calling import ntlk:
 
import nltk
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\IronPython 2.6\lib\site-packages\nltk__init__.py", lin
e 73, in C:\Program Files\IronPython 2.6\lib\site-packages\nltk__init__.py
File "C:\Program Files\IronPython 2.6\lib\site-packages\nltk\internals.py", li
ne 9, in C:\Program Files\IronPython 2.6\lib\site-packages\nltk\internals.py
ImportError: No module named subprocess

 
It looks like IronPython doesn't completely implement the Python portions needed to properly run NLTK.
 
Please note this error happens in versions 2.0.2 and the 2.6 beta.
 

----------------------------------------------------------------------------------------------------

REPRODUCTION SNIPPET:
 
Install NLTK from http://www.nltk.org/ using the Windows installer (make sure ntlk is installed inside IronPython's folder).
Launch IronPython Console and type import ntlk
You will get the above error.
Closed Nov 25, 2009 at 5:49 PM by dfugate

comments

mwiewiorka wrote Aug 26, 2009 at 8:02 PM

I managed to run NLTK under IronPython 2.02.
Here are the steps you need to take (all inlcuding adding missing Python moduled to IronPython):
  1. subprocess
    http://www.ironpython.info/index.php/The_subprocess_module
    (copy to lib folder of IronPython)
    2.zlib
    http://bitbucket.org/jdhardy/ironpythonzlib/downloads/
    (create "Dlls" and then copy to folder of IronPython)
    3.gzip
    http://www.defuze.org/oss/ipextra/gzip.txt
    (rename to gzip.py , add line : READ, WRITE = 1, 2 and copy to lib folder of IronPython + download sharZiplib and copy to "Dlls" folder of IronPython)
4.Expact
http://code.google.com/p/robotframework/issues/detail?id=154

darb wrote Sep 8, 2009 at 8:45 PM

dupe of missing subprocess support

wrote Nov 25, 2009 at 5:49 PM

wrote Feb 8, 2010 at 7:27 PM

wrote Feb 22, 2013 at 1:11 AM

wrote May 16, 2013 at 12:04 PM