Importing issues There was a post on this topic, ...
# ask-community
y
Importing issues There was a post on this topic, but I can't find it... if I have a project with the following structure: -- project -- source_code -- test_code -- prefect_workflows it appears to be a problem to use in the prefect flow a functions from the
source_code
folder, that have local imports, and that we need to create a python package in order to use local code. is this correct or is there some way around it ?
z
Hey @YD you can also extend the
PYTHONPATH
to include your code folders, but using a python package is generally better practice.
k
If you are using a Local agent, you can specify the
working_dir
path of your RunConfiguration. Docs .This will resolve those imports
y
checking... used
Copy code
flow.run_config = LocalRun(working_dir="/path/to/working-directory")
with the working_dir one above the
project
dir worked thanks