Python 3.14.0a3 regression: creating venv with --system-site-packages doesn't work (system packages are not detected) #128779
Copy link
Copy link
Closed
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-venvRelated to the venv moduleRelated to the venv moduletype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
venv created with --system-site-packages in Python 3.14.0a3 doesn't really see the site packages. This happens also with the current main.
Bisected to commit: 2b0e2b2
To reproduce:
$ ./configure --config-cache --without-ensurepip && make && make install DESTDIR=/tmp/python
$ /tmp/python/usr/local/bin/python3 -m venv venv --system-site-packages && ./venv/bin/python -c "import sys; print(sys.path)"
Python 3.14.0a2 on my system:
['', '/tmp/python/usr/local/lib/python314.zip', '/tmp/python/usr/local/lib/python3.14', '/tmp/python/usr/local/lib/python3.14/lib-dynload', '/home/user/dev/cpython/venv/lib/python3.14/site-packages', '/tmp/python/usr/local/lib/python3.14/site-packages']
Python 3.14.0a3/main on my system:
['', '/tmp/python/usr/local/lib/python314.zip', '/tmp/python/usr/local/lib/python3.14', '/tmp/python/usr/local/lib/python3.14/lib-dynload', '/home/user/dev/cpython/venv/lib/python3.14/site-packages']
The last item, '/tmp/python/usr/local/lib/python3.14/site-packages', disappeared from the sys.path.
$ cat ./venv/pyvenv.cfg
home = /tmp/python/usr/local/bin
include-system-site-packages = true
version = 3.14.0
executable = /tmp/python/usr/local/bin/python3.14
command = /tmp/python/usr/local/bin/python3 -m venv --system-site-packages /home/user/dev/cpython/venv
The content is the same in all cases, with include-system-site-packages = true.
More context in the Fedora bug tracker: https://bugzilla.redhat.com/show_bug.cgi?id=2336950
cc: @FFY00
CPython versions tested on:
3.14
Operating systems tested on:
Linux
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-venvRelated to the venv moduleRelated to the venv moduletype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
[-]Python 3.14.0a3 regression: creating venv with `--system-site-packages` doesn't work (site-packages are not detected)[/-][+]Python 3.14.0a3 regression: creating venv with `--system-site-packages` doesn't work (system packages are not detected)[/+]pythongh-128779: Fix site venv() for system site-packages
gh-128779: Fix site venv() for system site-packages (#129184)
pythonGH-128779: add test for venv --system-site-packages
FFY00 commentedon Jan 30, 2025
Fixed in GH-129184, it should be released in 3.14.0a5.
pythongh-128779: Fix site venv() for system site-packages (python#129184
Fix CI: skip system-site assertion on in-tree builds (pythongh-128779)
Fix CI: skip system-site assertion on in-tree builds (pythongh-128779)
GH-128779: add test for venv --system-site-packages (#129462)
gh-128779: Fix system site-packages test inside a virtual environment (…