Segmentation error (kernel reset) when calling python script from NodeJS via spawn

I have a python script that prints a long list through statistical R (PypeR). This python script is working absolutely fine.

Now I am trying to run this script from NodeJS using the spawn function for child_process, but it does not work with the following error: -

Traceback (most recent call last):
  File "pyper_sample.py", line 5, in <module>
    r=R()

  File "/home/mehtam/pyper.py", line 582, in __init__
    'prog' : Popen(RCMD, stdin=PIPE, stdout=PIPE, stderr=return_err and _STDOUT or childstderr, startupinfo=info), 
  File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__

    errread, errwrite)
  File "/usr/lib64/python2.6/subprocess.py", line 1234, in _execute_child

    raise child_exception
OSError: [Errno 2] No such file or directory

./temp.sh: line 1: 27500 Segmentation fault      (core dumped) python pyper_sample.py o1dn01.tsv cpu_overall

child process exited with code : 139

Note. My python script is working fine. I already tested it manually.

+3
source share
1 answer

My python script is working fine. I already tested it manually.

The output clearly shows that Popen()an exception occurred during the call OSError: No such file or directory.

This means that the program was not found, for example,

>>> from subprocess import Popen
>>> p = Popen(["ls", "-l"]) # OK
>>> total 0

>>> p = Popen(["no-such-program-in-current-path"])  
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

, (shell=False ) :

>>> p = Popen("ls -l")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

, :

  • () $PATH
  • , , , ..

: Popen() startupinfo Windows. , Windows, "No such file or directory" Unix.

+1

All Articles