sitecustomize.py not imported in a virtual environment
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python3.10 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
This is on Ubuntu 22.04, python3==3.10.4-3.
Run this:
$ python3.10 -mvenv ./venv
$ echo 'print("In sitecustomize.py")' > ./venv/
$ ./venv/bin/python -c ''
[nothing]
Expected output:
In sitecustomize.py
The reason this doesn't work is that the python3 package contains its own sitecustomize module (at /usr/lib/
I think the best way to fix this would be to:
1. Remove /usr/lib/
2. Add /usr/lib/
import apport_python_hook; apport_
This would have the same effect as the current sitecustomize.py, but would not conflict with user-provided sitecustomize modules.
Alternatively, /usr/lib/