Disable user site packages (~/.local
) for specific in-container Python components
#1959
Labels
comp:agent
Related to Agent component
type:enhance
Enhance component, behavior, internals without user-facing features
urgency:3
Must be finished within a certain time frame.
Milestone
When users install custom Python packages into the user-site directory (
~/.local
) which is provided as an auto-mounted docker volume in containers, sometimes they break the dependency of Jupyter making it to crash when starting the app.We could minimize the impact of dependency breakage due to user-installed packages as follows:
However, it is not possible to 100% prevent such problems because we cannot disable user-site directories for specific packages for a single Python process running both ipykernel and user programs.
Note
Some futuristic idea: We could make ipykernel to use subinterpreters in Python 3.12+ to isolate the package import namespaces (with different user-site settings) within a single process.
Still, I think it would be better to explicitly disable user-sites for the designated components to minimize the problem's surface area.
The text was updated successfully, but these errors were encountered: