Re: pip and venvs on Debian

Liste des GroupesRevenir à cl python 
Sujet : Re: pip and venvs on Debian
De : roel (at) *nospam* roelschroeven.net (Roel Schroeven)
Groupes : comp.lang.python
Date : 21. May 2024, 10:03:09
Autres entêtes
Message-ID : <mailman.43.1716278596.2909.python-list@python.org>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Mozilla Thunderbird
Op 20/05/2024 om 23:48 schreef Akkana Peck via Python-list:
Every so often I need to regenerate it (like when Debian updates the system Python version) but that's easy to do: I don't try to duplicate what's installed there, I just delete the old venv, create a new one and then pip install packages as needed.
>
I know this isn't the usual pythonista model of "you should have a zillion different venvs, one for each program you use, and never use system Python packages", but it works well for me: my pip installed packages are all in a predictable place, and I get security updates for all the software Debian *does* package. That's my biggest beef with pip, the lack of an easy way to update everything at once, and it's the reason I prefer Debian packages when available.
If you have a requirements.txt file with all packages you want, I think you can do pip -install --upgrade -r requirements.txt to update them all. That only works if you don't specify exact versions in the requirements.txt file, so don't use the output of pip freeze to generate that requirements file. Just create it yourself: it's a simple text file with one package per line. Also I prefer not to include dependencies in it for use cases like this (it's another story for packaging, where it can be useful or requirements.txt to mirror your exact environment with dependencies and specific versions).
Having such a requirements.txt file also makes it easier to install all the packages again after you re-create your venv.
--
"I love science, and it pains me to think that to so many are terrified
of the subject or feel that choosing science means you cannot also
choose compassion, or the arts, or be awed by nature. Science is not
meant to cure us of mystery, but to reinvent and reinvigorate it."
         -- Robert Sapolsky

Date Sujet#  Auteur
15 May 24 * Re: Terminal Emulator20Stefan Ram
16 May 24 `* Re: Terminal Emulator (Posting On Python-List Prohibited)19Lawrence D'Oliveiro
17 May 24  +- Re: Terminal Emulator (Posting On Python-List Prohibited)1Lawrence D'Oliveiro
18 May 24  +- Re: Terminal Emulator (Posting On Python-List Prohibited)1Peter J. Holzer
18 May 24  +- Re: Terminal Emulator (Posting On Python-List Prohibited)1Grant Edwards
18 May 24  +* Re: Terminal Emulator (Posting On Python-List Prohibited)14Mats Wichmann
18 May 24  i`* Re: Terminal Emulator (Posting On Python-List Prohibited)13Piergiorgio Sartor
19 May 24  i +* venvs vs. package management (was: Terminal Emulator (Posting On Python-List Prohibited))3Peter J. Holzer
19 May 24  i i`* Re: venvs vs. package management2Piergiorgio Sartor
20 May 24  i i `- Re: venvs vs. package management1Left Right
19 May 24  i +* Re: Terminal Emulator (Posting On Python-List Prohibited)5Alan Gauld
19 May 24  i i+- Re: Terminal Emulator (Posting On Python-List Prohibited)12QdxY4RzWzUUiLuE
19 May 24  i i+- Re: Terminal Emulator (Posting On Python-List Prohibited)1MRAB
19 May 24  i i+- Re: Terminal Emulator (Posting On Python-List Prohibited)12QdxY4RzWzUUiLuE
20 May 24  i i`- Re: Terminal Emulator (Posting On Python-List Prohibited)1Grant Edwards
19 May 24  i +- Re: Terminal Emulator (Posting On Python-List Prohibited)1Grant Edwards
19 May 24  i +- Re: Terminal Emulator (Posting On Python-List Prohibited)1Thomas Passin
20 May 24  i +- pip and venvs on Debian (was: Terminal Emulator)1Akkana Peck
21 May 24  i `- Re: pip and venvs on Debian1Roel Schroeven
18 May 24  `- Re: Terminal Emulator (Posting On Python-List Prohibited)1Grant Edwards

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal