Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
befeleme opened this issue Jan 13, 2025 · 0 comments
Labels
stdlib Python modules in the Lib dir topic-venv Related to the venv module type-bug An unexpected behavior, bug, or error

Comments

@befeleme
Copy link
Contributor

befeleme commented Jan 13, 2025

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

@befeleme befeleme added the type-bug An unexpected behavior, bug, or error label Jan 13, 2025
@befeleme befeleme changed the title 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) Jan 13, 2025
@picnixz picnixz added stdlib Python modules in the Lib dir topic-venv Related to the venv module labels Jan 13, 2025
vstinner added a commit to vstinner/cpython that referenced this issue Jan 22, 2025
Add sys.base_exec_prefix to prefixes if pyvenv.cfg enables system
site-packages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir topic-venv Related to the venv module type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants