[Python] How to use uv to install a package and add it to pyproject.toml at the same time?

Discussão em 'Python' iniciado por Stack, Abril 30, 2025.

  1. Stack

    Stack Membro Participativo

    I am using conda to manage my python venv. Here is how i set it up conda activate venv pip install uv uv init Until this step i have the pyproject.toml file in my project root. Now I want to install packages, I have to do these two commands uv add pandas then uv pip install pandas

    in order to 1. install the package 2. update the pyproject.toml. Is there anything wrong with my set up? Because i feel it should be done using only 1 command. Am I having a wrong expectation for uv?

    (tmp) root@v2202412247852306032:~/automation# which uv
    /root/anaconda3/envs/tmp/bin/uv
    (tmp) root@v2202412247852306032:~/automation# which python
    /root/anaconda3/envs/tmp/bin/python
    (tmp) root@v2202412247852306032:~/automation# which pip
    /root/anaconda3/envs/tmp/bin/pip

    Continue reading...

Compartilhe esta Página