I am trying to run a python script and I wanted d to run it with a more pythonic way rather than maybe calling subprocess.run()
.
I found the runpy
library and I am trying to call my script like this:
runpy.run_path(path_name='/home/dir1/dr2/dr3/run_code.py', run_name='__main__')
This returns me and error that one of the modules used in the run_code.py
does not exist:
ModuleNotFoundError: No module named 'fluent_logger'
When I run the same script with subprocess.run()
I get no errors.
Am I using this the wrong way?