Python Script unable to import installed modules when called as a subprocess
I've two Python scripts as given below
inner.py
#!/usr/bin/python
import os
import datetime
# <---- Some Code--->
main.py
#!/usr/bin/python
import os
import datetime
# <---- Some Code--->
subprocess.call(["/usr/bin/python",inner.py])
The problem is when the inner.py script is called from the main.py script
it doesn't import any modules. For example it says
ImportError: No module named os
But when the script is executed standalone it works fine. Please help
No comments:
Post a Comment