ImportError: No module named signal

1,163 views
Skip to first unread message

leas63

unread,
Mar 11, 2014, 1:33:32 PM3/11/14
to snip...@googlegroups.com
Hello,

I have added the following commands to a python script:

from subprocess import Popen

prog=subprocess.Popen(["./program"],stdin=PIPE,stdout=PIPE)


and when I try to run it, I get the following error:

Executing Python script /home/leas/Diploma/sniper-5.3/sim.scripts.py
Traceback (most recent call last):
  File "/home/leas/Diploma/sniper-5.3/sim.scripts.py", line 5, in <module>
    execfile("/home/leas/Diploma/sniper-5.3/scripts/stattracel.py")
  File "/home/leas/Diploma/sniper-5.3/scripts/stattracel.py", line 12, in <module>
    from subprocess import Popen
  File "/tmp/tmp.dxEiJiXap2/python_kit/lib/python2.7/subprocess.py", line 398, in <module>
ImportError: No module named signal
Cannot open Python script /home/leas/Diploma/sniper-5.3/sim.scripts.py


Can anyone help?Thanks!

Alexander

Trevor E. Carlson

unread,
Mar 11, 2014, 2:30:05 PM3/11/14
to snip...@googlegroups.com, leas63
Alexander,

Instead of Popen, you might want to try using os.system() to run external applications. We specifically removed a number of features from the Python distribution to make it safe to embed into a Pin tool. It should be possible to link against your system Python library or one that you download and compile yourself, but we will not support any problems that you run into.

Trevor

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

---
You received this message because you are subscribed to the Google Groups "Sniper simulator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to snipersim+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

leas63

unread,
Mar 12, 2014, 11:39:33 AM3/12/14
to snip...@googlegroups.com, leas63
I also want to pass data between the processes.
I tried os.popen , and I succesfully read the output of the second process, but when I try os.popen2 ,I get the same ImportError as before. Isn't that odd? I'd like to use popen2 to write data to the second process.

Wim Heirman

unread,
Mar 12, 2014, 11:47:39 AM3/12/14
to snip...@googlegroups.com, leas63
Alexander,

subprocess.Popen doesn't seem to actually use signals unless you explicitly ask it to by calling Popen.send_signal, .terminate or .kill. If you create an empty signal.py file somewhere where Python can find it (in python/scripts, or in python_kit/lib/python2.7), it will probably work. Just don't try sending signals to your subprocess.

Regards,
Wim

Reply all
Reply to author
Forward
0 new messages