i

    Italo Barros

    11 months ago
    Hi everyone, I'm facing some issues running two agents in different conda environments. I have a LocalDastExecutor agent in a conda environment with uses Python 3.6 (let's name env_1) and runs on a Windows Working DIR C:\Project_1, and another (LocalRun) in env_2 with uses Python 3.9. The first one is running okay, but when I try to run the second agent on Prefect Cloud I receive the following error:
    Failed to load and execute Flow's environment: FlowStorageError("An error occurred while unpickling the flow:\n TypeError('code() takes at most 15 arguments (16 given)',)\nThis may be due to one of the following version mismatches between the flow build and execution environments:\n - prefect: (flow built with '0.15.6', currently running with '0.15.3')\n - python: (flow built with '3.9.7', currently running with '3.6.12')",)
    I already tried to use LocalRun(working_dir="C:\Project_2") but doesn't seem to work either. How can I specify to the second agent that he needs to use the desired "env_2"?
    Kevin Kho

    Kevin Kho

    11 months ago
    A Prefect agent will use the environment that was used when you did
    prefect agent … start
    . If you did this in
    env_2
    , the agent will use
    env_2
    . Does that make sense?