https://prefect.io logo
Title
t

Tomás Emilio Silva Ebensperger

04/02/2021, 12:51 PM
I set up a virtual environment in my ubunutu machine for prefect. my question is why are results saved in the home/ubuntu/.prefect/results and not on the environment
z

Zach Angell

04/02/2021, 1:30 PM
Hi @Tomás Emilio Silva Ebensperger this is the default directory for Prefect
LocalResult
. I'm not 100% sure how it interacts with virtual environments, but the result directory is configurable. You can read a bit more about Results here https://docs.prefect.io/core/concepts/results.html#pipeline-persisted-results I think something like the following pattern would be helpful for your use case
from prefect import Flow, task
from prefect.engine.results import LocalResult

@task(result=LocalResult(dir='path/in/my/virutal/environment/'))
def my_task():
    return 3
:upvote: 2
t

Tomás Emilio Silva Ebensperger

04/02/2021, 3:09 PM
Thanks!