Hello again, has anyone come across this kind of b...
# ask-community
v
Hello again, has anyone come across this kind of bug before while running a flow?
v
I encountered a similar issue before. This was because the agent and the script to register the flow were running in different python environments. Perhaps, you did not activate your virtualenv when running either one.
v
Hey, thanks a lot for responding @vish. Am I supposed to allocate a virtuaenv for prefect flows? If yes, can you please send me link on how to do that?
v
you dont have to. Just gotta make sure the environment from which you are running the flow is the same as the one where u built/registered the flow with Prefect Cloud/Server
ie. python version, dependancies. I mentioned virtualenv as that was my undoing when I got a similar error
v
Hey @vish, thank you for that. Sorry to dig in more but how do you make sure that the flow is using the same environment? Is there a configuration page of prefect where you can assign it a python environment. I'm aware about the config.toml files along with other files (settings.toml, etc). Kindly let me know as per your convenience 🙂
v
How are u building/registering and running ur flows
v
Copy code
with Flow("data_flow") as flow:
    flow.storage = GCS(bucket="bucketname")
    parameter1 = Parameter("paramater1",default="default")
    parameter2 = Parameter("parameter2",default=1)
    metadata = extract_metadata(parameter1,parameter2)
    delta_push_wrapper(metadata)
flow.register(project_name="test_project")
In this way