https://prefect.io logo
j

joshua mclellan

01/26/2022, 2:27 AM
hey so im working with some legacy code that has working directory requirements (ie needs next to or one level up from a number of dependent files). When i run a flow locally in a script using flow.run() is there a way to have it run from a specific directory irrespective of where the python session is initialized from?
k

Kevin Kho

01/26/2022, 3:42 AM
For
flow.run()
no, but for a run with an agent, you can specify a working directory. If you have multiple directories, maybe you should just add them to the Python path , but also, I think you can use
sys.path.append
from the
flow.run()
process?