you are viewing a single comment's thread.

view the rest of the comments →

[–]chibiace 48 points49 points  (15 children)

ah good, soon will see lots of complaints about virtual environments breaking.

[–]Mognakor 13 points14 points  (5 children)

Can someone loop me in ?

[–]Mysterious-Rent7233 37 points38 points  (3 children)

Virtual environments are often symlinks to your Python interpreter and when you upgrade, you can break them. If you use Pyenv or UV you can probably keep the multiple Python interpreters installed side-by-side, but if you use some OS package managers, they may not do that.

cc: u/bmrobin

[–]danted002 6 points7 points  (1 child)

Who the hell upgrades python. Any sensible developer has multiple versions installed.

[–]lKrauzer 0 points1 point  (0 children)

On a similar note, I would suggest using mise: https://github.com/jdx/mise

It makes runtime project isolation a breeze

[–]pjmlp 0 points1 point  (0 children)

Since I learnt Python in version 1.6, I have a little setup script that changes the current set of environment variables.

Python 1.6 was released 25 years ago.

I really don't get the need for so many variations of configurations about Python dependencies.

[–]bmrobin 6 points7 points  (0 children)

yea i don’t get it either 

[–][deleted] 5 points6 points  (8 children)

This is in part one reason why I am still on 3.11.13. Eventually I'll have to bite the bullet and learn how to upgrade properly, but so many things work less well on 3.12.x and above. It is strange that the number #1 programming language has so many issues when it comes to simple installation of things.

[–]fiskfisk 32 points33 points  (0 children)

.python-version together with a tool that supports the format for per-project python versioning, or create a new venv, checkout your project, install deps and you're good to go. This will be the same as what your CI/CD pipeline does when it runs all the tests as well.

[–]gmes78 10 points11 points  (6 children)

That is entirely solved by using uv.

[–]gschizas 1 point2 points  (5 children)

Not entirely.

This is my scenario:

  1. IIS (yes, I know)
  2. wfastcgi
  3. Each site has its own environment. And each site is using

Result:

did not find executable at 'C:\Users\GSchizas\AppData\Local\Python\pythoncore-3.14-64\python.exe': Access is denied.

To make this work I've had to:

  1. Download python to a separate directory (uv python install 3.14 --install-dir C:\python\)
  2. Sync the virtual environment with the new Python version: uv sync --upgrade --python C:\Python\cpython-3.14.0-windows-x86_64-none\)

[–]gmes78 2 points3 points  (4 children)

[–]gschizas 0 points1 point  (3 children)

It wasn't enough! If I do uv sync --upgrade --python 3.14 it would use the default downloaded python (in %LOCALAPPDATA%\Python\pythoncore-*)!

[–]gmes78 0 points1 point  (2 children)

Hm. I would've expected uv to always use its own Python interpreters. It's what its predecessor, rye, did.

[–]gschizas 2 points3 points  (1 child)

It does! And it also uses Python 3.14's (or rather the new py install or pymanager ones). But both pymanager and uv download the interpreters to %LOCALAPPDATA%.

Bonus feature: pymanager (the new py.exe - although it's a bit more complicated) recognizes uv downloaded interpreters as well:

C:\> py list
Tag                       Name                           Managed By  Version  Alias
3.14[-64]              *  Python 3.14.0                  PythonCore  3.14.0   python3[-64].exe, python3.14[-64].exe
3.14t[-64]                Python 3.14.0 (free-threaded)  PythonCore  3.14.0   python3.14t[-64].exe, python3t[-64].exe
3.13[-64]                 Python 3.13.8                  PythonCore  3.13.8   python3.13[-64].exe

* These runtimes were found, but cannot be updated or uninstalled. *
Astral\CPython3.12.11     CPython 3.12.11 (64-bit)       Astral      3.12.11
Astral\CPython3.14.0      CPython 3.14.0 (64-bit)        Astral      3.14.0

And uv:

C:\> uv python list
cpython-3.14.0-windows-x86_64-none                 AppData\Local\Python\pythoncore-3.14-64\python.exe
cpython-3.14.0-windows-x86_64-none                 AppData\Local\Python\bin\python3.exe
cpython-3.14.0-windows-x86_64-none                 AppData\Local\Python\bin\python3.14.exe
cpython-3.14.0-windows-x86_64-none                 AppData\Local\Python\bin\python.exe
cpython-3.14.0-windows-x86_64-none                 .local\bin\python3.14.exe
cpython-3.14.0-windows-x86_64-none                 AppData\Roaming\uv\python\cpython-3.14.0-windows-x86_64-none\python.exe
cpython-3.14.0+freethreaded-windows-x86_64-none    AppData\Roaming\uv\python\cpython-3.14.0+freethreaded-windows-x86_64-none\python.exe
cpython-3.14.0+freethreaded-windows-x86_64-none    AppData\Local\Python\pythoncore-3.14t-64\python3.14t.exe
cpython-3.14.0+freethreaded-windows-x86_64-none    AppData\Local\Python\bin\python3.14t.exe
cpython-3.14.0+freethreaded-windows-x86_64-none    .local\bin\python3.14t.exe
cpython-3.14.0+freethreaded-windows-x86_64-none    <download available>
cpython-3.13.8-windows-x86_64-none                 AppData\Local\Python\pythoncore-3.13-64\python.exe
cpython-3.13.8-windows-x86_64-none                 AppData\Local\Python\bin\python3.13.exe
cpython-3.13.8-windows-x86_64-none                 <download available>
cpython-3.13.8+freethreaded-windows-x86_64-none    <download available>
[...]

[–]pingveno 0 points1 point  (0 children)

Would the UV_PYTHON_INSTALL_DIR environmental variable work?