0

This is the python code:

#!/tool/pandora64/bin/python2.7.5

import os

shellFileName = "envVaribles.sh"
startUpFilePath = 'source /proj/pdkfc8/users/srikumar/phython/testEnv/' + shellFileName
print(startUpFilePath)
os.system(startUpFilePath)

This is the bash script:

#!/bin/bash

module load cadenceICOA
module load calibre

When I tried to load the bash script from the terminal (source bash file) it is working fine. When I tried to load using python code it is saying module: command not found.

Kenly
  • 24,317
  • 7
  • 44
  • 60

1 Answers1

0

you can execute the bash script:

...
path = '/proj/pdkfc8/users/srikumar/phython/testEnv/' + shellFileName
startUpFilePath = path
...

or you can invoke the bash with the script

path = '/proj/pdkfc8/users/srikumar/phython/testEnv/' + shellFileName
startUpFilePath = '/bin/bash ' + path
...
napuzba
  • 6,033
  • 3
  • 21
  • 32
  • After using above solution.....still i am seeing "module: command not found" – srikumar440 Dec 28 '20 at 17:25
  • check in the terminal `which module` - it should give you full path to `module`, then update `module` in your script to this full path. – napuzba Dec 28 '20 at 17:30
  • module is a user interface to the Modules package. The Modules package provides for the dynamic modification of the user's environment via modulefiles. – srikumar440 Dec 29 '20 at 13:10