Skip to content

Python 3.14.0a3 regression: creating venv with --system-site-packages doesn't work (system packages are not detected) #128779

Closed
@befeleme

Description

@befeleme

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtopic-venvRelated to the venv moduletype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions