0

I tried setting ORACLE_HOME path from python script as below but it didn't work, any idea how can I set it?

>>> subprocess.call(["export", "ORACLE_HOME="+ORACLE_HOME], env= os.environ)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib64/python2.4/subprocess.py", line 419, in call
    return Popen(*args, **kwargs).wait()
  File "/usr/lib64/python2.4/subprocess.py", line 550, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.4/subprocess.py", line 996, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
>>> subprocess.call(["export", "ORACLE_HOME="+ORACLE_HOME])
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib64/python2.4/subprocess.py", line 419, in call
    return Popen(*args, **kwargs).wait()
  File "/usr/lib64/python2.4/subprocess.py", line 550, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.4/subprocess.py", line 996, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
0

1 Answer 1

1

Use os.environ:

os.environ['ORACLE_HOME'] = 'whatever'
Sign up to request clarification or add additional context in comments.

2 Comments

great.. thanks a lot. Any idea how to append to an existing PATH ?
@Shashi: os.environ['PATH'] += ':whatever'

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.