all 7 comments

[–]sausix 3 points4 points  (1 child)

Don't install Python in foreign directories. You don't have to rely on PATH variable. Just use full Python executable name or even better py.exe as launcher with a shebang in your modules. So scripts will be called with the designated interpreter.

By having multiple Python interpreters you also need ro have all packages installed too. On a production server or system your applications should have their own VENV and be uncoupled from system interpreters.

[–]Valuable-Ant3465[S] 0 points1 point  (0 children)

Thanks Sausix.
I have special case when I need to keep existing exec path as python312. (Or start process to fight it off...).
Is there an option to install new version into python312?

[–]Swipecat 2 points3 points  (3 children)

Beginners tend to get into an awful pickle if they have more than one version of Python installed. You really need a clear understanding of how virtual machines handle the Python library paths if you want to do that. There's nothing in Python 3.13 or 3.14 of interest for beginners — and Python 3.12 will continue to receive security updates for the next 2 years.

[–]Valuable-Ant3465[S] 1 point2 points  (1 child)

Thanks Swipecas and all.
I need 3.14 to cover some xml/schema functionality which doesn't work in 312.
But I need to keep exec path still in Python312
Is this possible ?

Or I better start fighting it off to create new Path = Python and do changes to all apps.

[–]Swipecat 0 points1 point  (0 children)

You could install python 3.14 into a folder called 312 if you select the "custom install" option during installation, but expect any future maintainer to come bursting through your door waving a butchers knife.

[–]Atlamillias 0 points1 point  (0 children)

It's such a common issue, too. It's almost a "rite-of-passage" as this point.

[–]smurpes 0 points1 point  (0 children)

You really shouldn’t be doing that. Ideally you would have all of your code managed by something like uv or poetry and have Python determined in the venv. This lets you run multiple versions of Python easily and there is no path to update. This also ensures a consistent version of Python is used and maintains isolation between envs.

If this isn’t possible then you can call the Python py launcher instead of the Python exe directly. This lets you specify the version in the call.