My first real request for help

Peter Otten __peter__ at web.de
Tue Nov 19 05:16:41 EST 2013


Gene Heskett wrote:

> Old python, 2.6.4 I believe, not update able from the Ubuntu 10.04.3 LTS
> repo's.
> 
> Should be a mauchs nichs as the code was written on, and is running on,
> several of these same linuxcnc installs.
> 
> But when I switch in, as one of the plugins a new .py version of camview-
> emc, I get this when I attempt to run linuxcnc -l, where the -l is "use
> the same config as last time" option.
> 
> Starting LinuxCNC...
> Traceback (most recent call last):
>   File "/usr/bin/axis", line 3326, in <module>
>     _dynamic_tabs(inifile)
>   File "/usr/bin/axis", line 3182, in _dynamic_tabs
>     child = Popen(cmd)
>   File "/usr/lib/python2.6/subprocess.py", line 633, in __init__
>     errread, errwrite)
>   File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child
>     raise child_exception
> OSError: [Errno 2] No such file or directory
> 
> No clue, even when straced, as to what file might be missing.
> 
> So, how do I find out?

How about inserting a

print cmd

before the line 

child = Popen(cmd)

? Depending on its value it may not even be a missing command, e. g.
This doesn't work:

Python 2.6.7 (r267:88850, Sep 28 2012, 16:26:39) 
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.Popen("ls -1")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

But this works:

>>> subprocess.Popen(["ls", "-1"])
<subprocess.Popen object at 0x7f8b31c5cfd0>
>>> alpha
beta
gamma

And this works, too (but is a bit less robust):

subprocess.Popen("ls -1", shell=True)
<subprocess.Popen object at 0x7f8b31c5cd90>
>>> alpha
beta
gamma





More information about the Python-list mailing list