From cumpuleddu at gmail.com Wed Nov 27 08:41:34 2013 From: cumpuleddu at gmail.com (cumpuleddu) Date: Wed, 27 Nov 2013 08:41:34 +0100 Subject: [execnet-dev] Bug in example Message-ID: <5295A22E.5010205@gmail.com> Hello everybody, I installed execnet on Windows 7. However, when running this example: gw = execnet.makegateway("popen//python=jython") channel = gw.remote_exec(""" from java.util import Vector v = Vector() v.add('aaa') v.add('bbb') for val in v: channel.send(val) """) for item in channel: print (item) I got this error: Traceback (most recent call last): File "F:\Documenti\Mistieru\Programmes\Python\ExecTest\ExecTest\src\exectest.py", line 20, in gw = execnet.makegateway("popen//python=jython") File "C:\execnet-1.1\execnet\multi.py", line 88, in makegateway io = gateway_io.create_io(spec) File "C:\execnet-1.1\execnet\gateway_io.py", line 90, in create_io return Popen2IOMaster(args) File "C:\execnet-1.1\execnet\gateway_io.py", line 17, in __init__ self.popen = p = Popen(args, stdin=PIPE, stdout=PIPE) File "C:\Users\Lisandru\AppData\Roaming\NetBeans\7.4\jython-2.5.1\Lib\subprocess.py", line 757, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\Lisandru\AppData\Roaming\NetBeans\7.4\jython-2.5.1\Lib\subprocess.py", line 1271, in _execute_child raise OSError(e.getMessage() or e) OSError: Cannot run program "jython" (in directory "F:\Documenti\Mistieru\Programmes\Python\ExecTest\ExecTest\src"): CreateProcess error=2, Le fichier sp?cifi? est introuvable [ie, FILE NOT FOUND] Thanks! Alex From holger at merlinux.eu Thu Nov 28 10:18:06 2013 From: holger at merlinux.eu (holger krekel) Date: Thu, 28 Nov 2013 09:18:06 +0000 Subject: [execnet-dev] Bug in example In-Reply-To: <5295A22E.5010205@gmail.com> References: <5295A22E.5010205@gmail.com> Message-ID: <20131128091806.GN11363@merlinux.eu> Hi, On Wed, Nov 27, 2013 at 08:41 +0100, cumpuleddu wrote: > Hello everybody, > I installed execnet on Windows 7. > However, when running this example: > > gw = execnet.makegateway("popen//python=jython") > channel = gw.remote_exec(""" > from java.util import Vector > v = Vector() > v.add('aaa') > v.add('bbb') > for val in v: > channel.send(val) > """) > > for item in channel: > print (item) > > I got this error: > > Traceback (most recent call last): > File "F:\Documenti\Mistieru\Programmes\Python\ExecTest\ExecTest\src\exectest.py", > line 20, in > gw = execnet.makegateway("popen//python=jython") > File "C:\execnet-1.1\execnet\multi.py", line 88, in makegateway > io = gateway_io.create_io(spec) > File "C:\execnet-1.1\execnet\gateway_io.py", line 90, in create_io > return Popen2IOMaster(args) > File "C:\execnet-1.1\execnet\gateway_io.py", line 17, in __init__ > self.popen = p = Popen(args, stdin=PIPE, stdout=PIPE) > File "C:\Users\Lisandru\AppData\Roaming\NetBeans\7.4\jython-2.5.1\Lib\subprocess.py", > line 757, in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > File "C:\Users\Lisandru\AppData\Roaming\NetBeans\7.4\jython-2.5.1\Lib\subprocess.py", > line 1271, in _execute_child > raise OSError(e.getMessage() or e) > OSError: Cannot run program "jython" (in directory > "F:\Documenti\Mistieru\Programmes\Python\ExecTest\ExecTest\src"): > CreateProcess error=2, Le fichier sp?cifi? est introuvable [ie, FILE > NOT FOUND] I think it's because "jython" is not found. Try specifying the path to the jython executable. cheers, holger > > Thanks! > Alex > _______________________________________________ > execnet-dev mailing list > execnet-dev at python.org > https://mail.python.org/mailman/listinfo/execnet-dev > From holger at merlinux.eu Thu Nov 28 11:23:32 2013 From: holger at merlinux.eu (holger krekel) Date: Thu, 28 Nov 2013 10:23:32 +0000 Subject: [execnet-dev] Bug in example In-Reply-To: <529714CD.3040303@gmail.com> References: <5295A22E.5010205@gmail.com> <20131128091806.GN11363@merlinux.eu> <529714CD.3040303@gmail.com> Message-ID: <20131128102332.GQ11363@merlinux.eu> On Thu, Nov 28, 2013 at 11:02 +0100, cumpuleddu wrote: > Thanks Holger, > I thought it was the problem, but even setting the path to jython > executable I got the error... Could you tell exactly the line how you specified that path? You need to be careful with escaping on windows wrt "\" etc. > Just for test, I tried replacing > gw = execnet.makegateway("popen//python=jython") > BY > gw = execnet.makegateway("popen//python=python") > Here, python executable is found... Maybe "python" in on your system wide PATH? Try typing "python" and "jython" in a cmdline window. holger > Alex > >Hi, > > > >On Wed, Nov 27, 2013 at 08:41 +0100, cumpuleddu wrote: > >>Hello everybody, > >>I installed execnet on Windows 7. > >>However, when running this example: > >> > >> gw = execnet.makegateway("popen//python=jython") > >> channel = gw.remote_exec(""" > >> from java.util import Vector > >> v = Vector() > >> v.add('aaa') > >> v.add('bbb') > >> for val in v: > >> channel.send(val) > >> """) > >> > >> for item in channel: > >> print (item) > >> > >>I got this error: > >> > >>Traceback (most recent call last): > >> File "F:\Documenti\Mistieru\Programmes\Python\ExecTest\ExecTest\src\exectest.py", > >>line 20, in > >> gw = execnet.makegateway("popen//python=jython") > >> File "C:\execnet-1.1\execnet\multi.py", line 88, in makegateway > >> io = gateway_io.create_io(spec) > >> File "C:\execnet-1.1\execnet\gateway_io.py", line 90, in create_io > >> return Popen2IOMaster(args) > >> File "C:\execnet-1.1\execnet\gateway_io.py", line 17, in __init__ > >> self.popen = p = Popen(args, stdin=PIPE, stdout=PIPE) > >> File "C:\Users\Lisandru\AppData\Roaming\NetBeans\7.4\jython-2.5.1\Lib\subprocess.py", > >>line 757, in __init__ > >> self._execute_child(args, executable, preexec_fn, close_fds, > >> File "C:\Users\Lisandru\AppData\Roaming\NetBeans\7.4\jython-2.5.1\Lib\subprocess.py", > >>line 1271, in _execute_child > >> raise OSError(e.getMessage() or e) > >>OSError: Cannot run program "jython" (in directory > >>"F:\Documenti\Mistieru\Programmes\Python\ExecTest\ExecTest\src"): > >>CreateProcess error=2, Le fichier sp?cifi? est introuvable [ie, FILE > >>NOT FOUND] > >I think it's because "jython" is not found. Try specifying > >the path to the jython executable. > > > >cheers, > >holger > > > >>Thanks! > >>Alex > >>_______________________________________________ > >>execnet-dev mailing list > >>execnet-dev at python.org > >>https://mail.python.org/mailman/listinfo/execnet-dev > >> > From cumpuleddu at gmail.com Thu Nov 28 11:02:53 2013 From: cumpuleddu at gmail.com (cumpuleddu) Date: Thu, 28 Nov 2013 11:02:53 +0100 Subject: [execnet-dev] Bug in example In-Reply-To: <20131128091806.GN11363@merlinux.eu> References: <5295A22E.5010205@gmail.com> <20131128091806.GN11363@merlinux.eu> Message-ID: <529714CD.3040303@gmail.com> Thanks Holger, I thought it was the problem, but even setting the path to jython executable I got the error... Just for test, I tried replacing gw = execnet.makegateway("popen//python=jython") BY gw = execnet.makegateway("popen//python=python") Here, python executable is found... Alex > Hi, > > On Wed, Nov 27, 2013 at 08:41 +0100, cumpuleddu wrote: >> Hello everybody, >> I installed execnet on Windows 7. >> However, when running this example: >> >> gw = execnet.makegateway("popen//python=jython") >> channel = gw.remote_exec(""" >> from java.util import Vector >> v = Vector() >> v.add('aaa') >> v.add('bbb') >> for val in v: >> channel.send(val) >> """) >> >> for item in channel: >> print (item) >> >> I got this error: >> >> Traceback (most recent call last): >> File "F:\Documenti\Mistieru\Programmes\Python\ExecTest\ExecTest\src\exectest.py", >> line 20, in >> gw = execnet.makegateway("popen//python=jython") >> File "C:\execnet-1.1\execnet\multi.py", line 88, in makegateway >> io = gateway_io.create_io(spec) >> File "C:\execnet-1.1\execnet\gateway_io.py", line 90, in create_io >> return Popen2IOMaster(args) >> File "C:\execnet-1.1\execnet\gateway_io.py", line 17, in __init__ >> self.popen = p = Popen(args, stdin=PIPE, stdout=PIPE) >> File "C:\Users\Lisandru\AppData\Roaming\NetBeans\7.4\jython-2.5.1\Lib\subprocess.py", >> line 757, in __init__ >> self._execute_child(args, executable, preexec_fn, close_fds, >> File "C:\Users\Lisandru\AppData\Roaming\NetBeans\7.4\jython-2.5.1\Lib\subprocess.py", >> line 1271, in _execute_child >> raise OSError(e.getMessage() or e) >> OSError: Cannot run program "jython" (in directory >> "F:\Documenti\Mistieru\Programmes\Python\ExecTest\ExecTest\src"): >> CreateProcess error=2, Le fichier sp?cifi? est introuvable [ie, FILE >> NOT FOUND] > I think it's because "jython" is not found. Try specifying > the path to the jython executable. > > cheers, > holger > >> Thanks! >> Alex >> _______________________________________________ >> execnet-dev mailing list >> execnet-dev at python.org >> https://mail.python.org/mailman/listinfo/execnet-dev >> From holger at merlinux.eu Thu Nov 28 12:37:28 2013 From: holger at merlinux.eu (holger krekel) Date: Thu, 28 Nov 2013 11:37:28 +0000 Subject: [execnet-dev] Bug in example In-Reply-To: <5295A22E.5010205@gmail.com> References: <5295A22E.5010205@gmail.com> Message-ID: <20131128113728.GT11363@merlinux.eu> On Wed, Nov 27, 2013 at 08:41 +0100, cumpuleddu wrote: > ... > File "C:\execnet-1.1\execnet\gateway_io.py", line 17, in __init__ > self.popen = p = Popen(args, stdin=PIPE, stdout=PIPE) > File "C:\Users\Lisandru\AppData\Roaming\NetBeans\7.4\jython-2.5.1\Lib\subprocess.py", > line 757, in __init__ > self._execute_child(args, executable, preexec_fn, close_fds, > File "C:\Users\Lisandru\AppData\Roaming\NetBeans\7.4\jython-2.5.1\Lib\subprocess.py", > line 1271, in _execute_child > raise OSError(e.getMessage() or e) > OSError: Cannot run program "jython" (in directory The issue seems to be there independent from execnet. You could try to print out in C:\execnet-1.1\execnet\gateway_io.py", line 17 what "args" is and then try to do the call yourself in a little script (subprocess.Popen(args)) and find out how to make that work. sorry but can't be more helpful ATM. holger > "F:\Documenti\Mistieru\Programmes\Python\ExecTest\ExecTest\src"): > CreateProcess error=2, Le fichier sp?cifi? est introuvable [ie, FILE > NOT FOUND] > > > Thanks! > Alex > _______________________________________________ > execnet-dev mailing list > execnet-dev at python.org > https://mail.python.org/mailman/listinfo/execnet-dev > From cumpuleddu at gmail.com Thu Nov 28 12:24:26 2013 From: cumpuleddu at gmail.com (cumpuleddu) Date: Thu, 28 Nov 2013 12:24:26 +0100 Subject: [execnet-dev] Bug in example In-Reply-To: <20131128102332.GQ11363@merlinux.eu> References: <5295A22E.5010205@gmail.com> <20131128091806.GN11363@merlinux.eu> <529714CD.3040303@gmail.com> <20131128102332.GQ11363@merlinux.eu> Message-ID: <529727EA.2080507@gmail.com> > Could you tell exactly the line how you specified that path? > You need to be careful with escaping on windows wrt "\" etc. here is the full code: import execnet import sys if __name__ == "__main__": reload(sys) sys.setdefaultencoding('utf-8') sys.path.append("C:\\execnet-1.1") sys.path.append("C:\\Jython25\\bin") print sys.path gw = execnet.makegateway("popen//python=jython") channel = gw.remote_exec(""" from java.util import Vector v = Vector() v.add('aaa') v.add('bbb') for val in v: channel.send(val) """) for item in channel: print (item) And Output path: ['F:\\Documenti\\Mistieru\\Programmes\\Python\\ExecTest\\ExecTest\\src', 'C:\\Users\\Lisandru\\AppData\\Roaming\\NetBeans\\7.4', 'C:\\Windows\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'F:\\Documenti\\Mistieru\\Programmes\\Python\\ExecTest\\ExecTest\\src', 'C:\\execnet-1.1', 'C:\\execnet-1.1', 'C:\\Jython25\\bin'] > >> Just for test, I tried replacing >> gw = execnet.makegateway("popen//python=jython") >> BY >> gw = execnet.makegateway("popen//python=python") >> Here, python executable is found... > Maybe "python" in on your system wide PATH? yes, but I added Jython too, to be sure... > Try typing "python" and "jython" in a cmdline window. both are working... Thanks, Alex > holger From cumpuleddu at gmail.com Thu Nov 28 13:50:10 2013 From: cumpuleddu at gmail.com (cumpuleddu) Date: Thu, 28 Nov 2013 13:50:10 +0100 Subject: [execnet-dev] Bug in example In-Reply-To: <20131128113728.GT11363@merlinux.eu> References: <5295A22E.5010205@gmail.com> <20131128113728.GT11363@merlinux.eu> Message-ID: <52973C02.5000907@gmail.com> Le 28/11/2013 12:37, holger krekel a ?crit : > On Wed, Nov 27, 2013 at 08:41 +0100, cumpuleddu wrote: >> ... >> File "C:\execnet-1.1\execnet\gateway_io.py", line 17, in __init__ >> self.popen = p = Popen(args, stdin=PIPE, stdout=PIPE) >> File "C:\Users\Lisandru\AppData\Roaming\NetBeans\7.4\jython-2.5.1\Lib\subprocess.py", >> line 757, in __init__ >> self._execute_child(args, executable, preexec_fn, close_fds, >> File "C:\Users\Lisandru\AppData\Roaming\NetBeans\7.4\jython-2.5.1\Lib\subprocess.py", >> line 1271, in _execute_child >> raise OSError(e.getMessage() or e) >> OSError: Cannot run program "jython" (in directory > The issue seems to be there independent from execnet. You could try to > print out in C:\execnet-1.1\execnet\gateway_io.py", line 17 what "args" > is and then try to do the call yourself in a little script > (subprocess.Popen(args)) and find out how to make that work. > > sorry but can't be more helpful ATM. thanks holger, here is the modification added to line 17: args[0]="C:\\Jython25\\bin\\"+args[0]+".bat" example is working then. Alex > holger > > >> "F:\Documenti\Mistieru\Programmes\Python\ExecTest\ExecTest\src"): >> CreateProcess error=2, Le fichier sp?cifi? est introuvable [ie, FILE >> NOT FOUND] >> >> >> Thanks! >> Alex >> _______________________________________________ >> execnet-dev mailing list >> execnet-dev at python.org >> https://mail.python.org/mailman/listinfo/execnet-dev >>