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.

4
  • 1
    What is module command? Have you added the directory that has it to your $PATH? Commented Dec 28, 2020 at 16:46
  • when i run the bash script in terminal it doesn't complaint...based on that i am thinking directory is added to the $PATH Commented Dec 28, 2020 at 17:27
  • module: command not found clearly shows that it's not added to $PATH. Commented Dec 28, 2020 at 17:29
  • Do the answers to this question solve the problem? Commented Dec 30, 2020 at 5:07

1 Answer 1

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
...
Sign up to request clarification or add additional context in comments.

3 Comments

After using above solution.....still i am seeing "module: command not found"
check in the terminal which module - it should give you full path to module, then update module in your script to this full path.
module is a user interface to the Modules package. The Modules package provides for the dynamic modification of the user's environment via modulefiles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.