How does NLTK use the subprocess module?

233 views
Skip to first unread message

williamj

unread,
Jun 15, 2010, 9:27:14 AM6/15/10
to nltk-users

I posted to nltk-dev but did not get a reply.

Here is my original post:

Here is a forward from a developer who wrote an alternate version of
the subprocess module for IronPython:

>Hi William,
>
>> Can your subprocess module for IronPython work with the NLTK?
>
>It looks like NLTK uses Popen.communicate(), which my subprocess module does not support. I'm not sure what it would take to support since it's been a long time since I looked at the code (2007, apparently).
>
>However, it looks like NLTK only uses it for external programs - if those are optional, it might be enough to just have the subprocess module there so that it can be imported, even if it's never actually used.
>
>- Jeff

Can I have some input regarding the use of subprocess?

Thanks.

Pedro Marcal

unread,
Jun 15, 2010, 3:53:19 PM6/15/10
to nltk-...@googlegroups.com
Hi William,
I ran into trouble trying to run Jacob's demo problem. He suggested I go to the execnet support.
Here is what I got and Holger's (execnet developer) support.
> Windows7 on ic5.

"ic5"? i haven't used windows7 myself yet.

> opening 4 gateways at localhost
>
>
> Traceback (most recent call last):
>   File "C:/CD_data/run_tag_files.py", line 20, in <module>
>     gw = execnet.makegateway('ssh=%s//nice=%d' % (host, NICE))
>   File
> "C:\Python26\lib\site-packages\execnet-1.0.6-py2.6.egg\execnet\multi.py",
> line 80, in makegateway
>     ssh_config=spec.ssh_config, id=id)
>   File
> "C:\Python26\lib\site-packages\execnet-1.0.6-py2.6.egg\execnet\gateway.py",
> line 200, in __init__
>     super(SshGateway, self).__init__(args, id=id)
>   File
> "C:\Python26\lib\site-packages\execnet-1.0.6-py2.6.egg\execnet\gateway.py",
> line 139, in __init__
>     self._popen = p = Popen(args, stdin=PIPE, stdout=PIPE)
>   File "C:\Python26\lib\subprocess.py", line 633, in __init__
>     errread, errwrite)
>   File "C:\Python26\lib\subprocess.py", line 842, in _execute_child
>     startupinfo)
> WindowsError: [Error 2] The system cannot find the file specified
> [DEBUG ON]

Do you have ssh installed as a command line tool in your windows environment?
I think people did so and had success using ssh-gateways on windows.
If you really just want some "localhost" processes you could just
use "popen//nice=..." which creates sub processes and works without
external dependencies.

cheers,
holger



--
You received this message because you are subscribed to the Google Groups "nltk-users" group.
To post to this group, send email to nltk-...@googlegroups.com.
To unsubscribe from this group, send email to nltk-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nltk-users?hl=en.


Reply all
Reply to author
Forward
0 new messages