Thread
#prefect-community
    jake lee

    jake lee

    11 months ago
    Hi for a localRun is there way to specify which virtualenv to run the task on? I’m using pyenv but the task is not running on the local pyenv environment but rather on the system default python
    Kevin Kho

    Kevin Kho

    11 months ago
    Hey @jake lee, when you do
    prefect agent local start
    , it uses the environment that it spun up from. So you can change your env before running the agent and the agent will use that env.
    jake lee

    jake lee

    11 months ago
    i did that but it seemed like it doesnt run on top of its pyenv… i will try again though
    @Kevin Kho Hey Kevin! I tried and still doesnt work. I activated my desired pyenv and launched the prefect local agent , but the actual task is deployed on the system default python. Do you have any relevent resource where I can check out?
    Kevin Kho

    Kevin Kho

    11 months ago
    So I haven't used pipenv myself since I use conda and I am sure it works for conda. Do you wanna try with that?
    Is that task invoking python? It's not right? just making sure. You mean the whole flow is the wrong python env?
    jake lee

    jake lee

    11 months ago
    the whole flow is running on the default python environment. and all of our team is using pyenv which is a challenge to change to conda… well let me know if you get to see anything that I can refer to!
    Kevin Kho

    Kevin Kho

    11 months ago
    i dont have anything in mind because it's actually the first time i've seen someone report the issue, but I can dive deeper and try tom. are you using pyenv (is that different from pipenv)?
    wait sorry what is the error you run into so i can try and replicate?
    ModuleNotFoundError
    on an import like
    pandas
    ?
    jake lee

    jake lee

    11 months ago
    yeap so i had to install the module in the main environment instead of pyenv virtual env
    and yes I am using pyenv and I believe its different from pipenv!
    Kevin Kho

    Kevin Kho

    11 months ago
    ok will give this a shot
    I am not confident that the local agent is going to use
    pyenv
    . Still looking into this.
    Really if I don’t have an update in a day or two, I would suggest opening a Github issue to track this (or I can for you)