Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: rbowman Newsgroups: comp.os.linux.misc Subject: Re: Defeat Python "Virtual Environment" in Fedora ? Date: 12 Mar 2026 02:11:50 GMT Lines: 35 Message-ID: References: <10olgca$2vj8v$1@dont-email.me> <10opbd6$aupd$1@dont-email.me> <2l368m-do5.ln1@lazy.lzy> <10osioo$3e4cl$1@dont-email.me> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net N4TC8ke0FsMm21SOZ29Y1AEIU0cqxs2vGDGCWTYEW2n18p0Nlf Cancel-Lock: sha1:7+0MWpLsMwresjTaQ8ppb826hFE= sha256:kCavZBgzFQzpyEGXdBaeex3nb/wuy3g5c2ArRFAS4Gc= User-Agent: Pan/0.162 (Pokrosvk) Xref: csiph.com comp.os.linux.misc:82871 On Wed, 11 Mar 2026 20:19:35 +0000, Pancho wrote: > My understanding is different. My understanding is that a venv only uses > packages installed locally in the venv. It shouldn't default to a > global package if it is not found in the venv. You can use --system-site-packages. https://docs.python.org/3/library/venv.html https://jonny0211.medium.com/python-virtualenv-and-venv-dos-and-donts- abf1b83cf943 One example is something I've just been playing with. Fedora 44 (beta) has PyQt5 in the system site packages. PyQt6 doesn't massively break stuff but there are differences so I'd rather start using it. I could create a venv and use pip to install PyQt6. otoh, with Fedora 'dnf install pyqt6' will install it in the system packages. It isn't the hugest package but if I have a project that also uses packages not in the site- packages, --system-site-packages will pick it up and I can use pip to install the other packages in the venv. Even more complicated PySide6 is not available from the Fedora repositories. Also, it still isn't compatible with Python 3.14, the default for Fedora 44. (and 43). In this case I need to use a venv, and I also used uv so the venv would by base on the 3.13 Python still on the machine. Then I can use 'uv pip install pyside6' and get on with life. As the second link says for a quick and dirty script you probably can get by without a venv. After making some edits to a simple PyQt5 script to update to PyQt6 I can run it outside of an venv, but only because I could install the PyQt6 packages to the system site-packages. On Ubuntu 25.10 I would be out of luck since that package isn't in the Ubuntu repositories.