You are not logged in.

#1 2025-02-22 11:43:53

audiomuze
Member
Registered: 2014-03-31
Posts: 105

How Python updates in Arch result in venv destruction?

Some time back I established a virtual environment for all my python scripts, 3rd party libraries they rely on etc. using

python -m venv envname

  This was done specifically to avoid having my codebase disrupted by Python related changes / upgrades to my Arch install.  I'd had no issues for the better part of a year, all updates to Arch left my venv unaffected and running as intended.  I'd not run the code from the venv in some time, but now coming back to it I'm getting tons of

ModuleNotFoundError:

messages despite running the scripts from the venv:

source ~/pvenv/bin/activate
~/pvenv/bin/python scriptname.py

Surely the modules are all still present in the venv (I can't imagine an Arch update would touch virtual environments)?  If that's the case where have I gone wrong and how do I avoid this mess going forward?

Last edited by audiomuze (2025-02-22 13:14:27)


Linux user #338966

Offline

#2 2025-02-22 12:06:12

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,987

Re: How Python updates in Arch result in venv destruction?

https://bbs.archlinux.org/viewtopic.php?id=295310 mentions after some python upgrades the venv may need to be recreated.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2025-02-23 06:59:55

Brocellous
Member
Registered: 2017-11-27
Posts: 161

Re: How Python updates in Arch result in venv destruction?

venv just symlinks the interpreter. Your pyenv/bin/python is just a symlink to /usr/bin/python. It doesn't even link the versioned name, so your old venv may even have a /bin/python3.12 that is a link which resolves to 3.13.

Offline

Board footer

Powered by FluxBB