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

FeatureRequest: Allow disabling system paths #212

Open
dkumor opened this issue Jan 25, 2021 · 1 comment
Open

FeatureRequest: Allow disabling system paths #212

dkumor opened this issue Jan 25, 2021 · 1 comment

Comments

@dkumor
Copy link

dkumor commented Jan 25, 2021

I am trying to run a Jupyter server instance inside a venv, which is completely isolated from the main system Jupyter. It was my understanding that I could set JUPYTER_CONFIG_DIR and JUPYTER_DATA_DIR to replace all search paths, so that it no longer touches global configuration. However, it looks like the system paths are added to the search paths no matter what is done:

https://github.com/jupyter/jupyter_core/blob/master/jupyter_core/paths.py#L174
https://github.com/jupyter/jupyter_core/blob/master/jupyter_core/paths.py#L228

This means, for example, that if I have jupyter lab installed globally, but not in the venv, running jupyter-notebook in the venv will give ModuleNotFoundError: No module named 'jupyterlab' during startup, no matter what.

Is there a way to isolate jupyter server inside a venv? Ideally, there would be a NO_SYSTEM_CONFIG_PATH environmental variable that, when set, does not add the system config directories.

I would be very happy to create a PR with this fix, so long as I know that something like this would be considered.

@rgbkrk
Copy link
Member

rgbkrk commented Mar 3, 2021

This sounds like a really good idea to make sure an environment is truly encapsulated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants