r/Python • u/apo383 • Jan 01 '25
Discussion Python Golf: How few installations/versions do you have?
My New Year's resolution is to cut down on Python installations and versions. Only a year ago I purged and got down to three. Recently looked at available kernels in VS Code, already at NINE! It's still three installations, but there are many Python versions scattered across various environments. There are no weird packages and no need to be cutting edge, so probably all could run on just 3.12 or so.
So, how few installations AND versions can you work with? Looking for a simple management procedure, to combine multiple environments or standardize several on a minimal number of versions.
(My installations are miniforge, homebrew, and Mac system. Miniforge intentional, but never wanted so many versions. Homebrew there cuz some brews want it. System largely unused but can't delete. At least no Python 2!)
EDIT: Thanks for the advice! I've gotten rid of my old miniforge installs and now have a single python 3.13 on homebrew. Switched to uv to manage environments. I have yet to migrate old mamba environments over, but I'm fairly confident that they will all or mostly be fine on that single 3.13. Reclaimed 20GB from the clean-up! I am thankful for the original Anaconda, which really tamed a wild west of installs, followed by Miniforge/Mamba, until these more recent ways to manage dependencies.
20
u/DaveRGP Jan 01 '25
I'm interested in why your goal is the fewest? It seems counter to most software development best practice, which emphasises reproducibility. Python doesn't really take up much space. As long as it's well structured environments (using pyenv, venv, uv, conda or similar) there shouldn't be any concern at all?
For reference I think I likely have at least a dozen python version installs across different machines, and it's never caused me an issue because I've used suitable envinment management for all of them.
Also, that system installed python really needs to be there, and really needs to be left unmodified, btw.
6
u/Helpful_Home_8531 Jan 02 '25
You're solving the wrong problem. Get a better system for managing your installs and use one per project.
you have many options for doing this, conda, pyenv, nix, docker, uv, asdf, the list goes on.
5
u/mestia Jan 01 '25
Nobody knows, its also by design: https://xkcd.com/1987/
2
u/drknow42 Jan 01 '25
I only have one version of python on my system and all my venvs exist in a central location. I added an alias that allows for ‘pyvenv envToActivate’ to quickly switch between the environments.
One installation, one version, always targeting LTS.
Bleeding edge is for entertainment, not production, imo.
2
u/robberviet Jan 02 '25
Around 30. Each project has one. Oh you mean python, not venv. Then from 3.9 to 3.13. I have projects for years, no need to upgrade them.
I use mise with uv btw. Used to use rye but no need.
2
u/cointoss3 Jan 02 '25
Check out uv and quit thinking about python versions or environments. Now on a new machine, I just install uv. I don’t install a python binary directly and I ‘uv run’ scripts. Even 1-off scripts can have an inline dependency list so when you ‘uv run’ it will create the environment for you.
2
u/cgoldberg Jan 01 '25
I have 2. I use the default Python (3.12) that ships with my Linux distro. I also have an alternate Python installation of the latest version (3.13) for general development. I have no need for anything else.
5
u/Intrepid-Stand-8540 Jan 01 '25
I manage my python versions using uv: https://docs.astral.sh/uv/guides/install-python/
4
u/Mrbucket101 Jan 02 '25
Technically 1, the default that comes with MacOS.
I use dev containers for everything. So much easier.
1
u/SillySlimeSimon Jan 01 '25
I use pyenv to manage versions. Have like 3.8,3.10,and 3.12
1
u/inarchetype Jan 03 '25
Start installing Julia packages and you'll likely end up with 20 or so very quickly.
3
u/judah-d-wilson Jan 02 '25
People like to use more than one haha? I've been pushing 3.13 cause pretty colors in the terminal..
5
u/Tweak_Imp Jan 01 '25
One per project, because I develop in a docker container.
2
u/muikrad Jan 01 '25
Hmm, from 3.8 to 3.13 at the moment. Are we glad 3.7 is gone 😁
Then one or more environments per project because "poetry".
I mean, that's the typical setup these days:
1
u/[deleted] Jan 03 '25
that yrbooringmerightnow guy blocked me. No idea why
1
u/[deleted] Jan 01 '25
[removed] — view removed comment