execvpe weirdness

Nathan Gray n8gray at caltech.edu.is.my.e-mail.address
Tue Feb 20 22:56:59 EST 2001


When I run the following script I get this error message:

Error: Cannot find images in /usr/local/bin
Apparently, Webots is not properly installed
You must set the environment variable _HOME to the
location of the  directory and re-run .
For example: export _HOME=/usr/local/
or:          setenv _HOME /usr/local/ 

This is the error you should get if WEBOTS_HOME is not set correctly, 
but the error should complain about WEBOTS_HOME, not _HOME!

Can somebody tell me where I've gone wrong?

Thanks,
-n8

-- 
_.~'^`~._.~'^`~._.~'^`~._.~'^`~._.~'^`~._
               Nathaniel Gray
     California Institute of Technology
      Computation and Neural Systems
       n8gray <at> caltech <dot> edu
_.~'^`~._.~'^`~._.~'^`~._.~'^`~._.~'^`~._

------------------- Text of runwebots ----------------------
#!/usr/bin/env python

import os, sys

# Parse command line
if len(sys.argv) < 2:
     print "Usage: runwebots (203|201)"
     sys.exit(1)

elif sys.argv[1] == "201":
     webotsDir = "/usr/local/webots"
     rcFile = ".webotsrc201"

elif sys.argv[1] == "203":
     webotsDir = "/home1/webots"
     rcFile = ".webotsrc203"

else:
     print "Usage: runwebots (203|201)"
     sys.exit(-1)

# Set up filenames and env. variables
execName = webotsDir + "/webots"
os.environ["WEBOTS_HOME"]=webotsDir
os.environ["LD_LIBRARY_PATH"]=""

# Make a link to the appropriate config file
home = os.environ["HOME"]
try:
     os.remove(home + "/.webotsrc")
except OSError:
     pass #link doesn't exist
os.symlink(rcFile, home + "/.webotsrc")

# And away we go
print "Running " + execName
os.execvpe(execName, [''], os.environ)




More information about the Python-list mailing list