[Python] uv Python package manager. What is the base environment when doing 'uv venv'. Does it...

Discussão em 'Python' iniciado por Stack, Maio 9, 2025.

  1. Stack

    Stack Membro Participativo

    I went to my project directory and ran

    uv init


    thinking that this would create a default virtual environment. It did not. I added in a few dozen dependencies now appearing in file myproject.toml. But now I want to make this environment available outside uv. For example, I want to run

    uvicorn myserver.py


    Because I cannot of course run uvicorn uv run myserver.py. So to me the documents are not clear in uv about what the baseline is when doing

    uv venv


    I really need to know if it starts from the project's myproject.toml or something else. Will it start from scratch and ignore myproject.toml? Overwrite myproject.toml, etc.?

    Please clarify. If it does start from scratch and ignore myproject.toml, is there a way to initialise a venv environment with the myproject.toml contents?

    Will running uv sync actually create the .venv? I only did uv init in the project directory initially. So far its not creating the .venv directory.

    Continue reading...

Compartilhe esta Página