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
Prepend PATH with environment's bin when loading kernel #395
Comments
|
Summarizing jupyter/notebook#4527 here as it is more relevant to Issue summaryWhen activating an env in the terminal, the PATH is prepended with the environment's bin dir. Instead, when running the notebook from a base environment and loading the kernel of another env, the PATH is not changed. This causes issues with tools that need to call executables, expecting them to be in the PATH. This is the case for Stop-gap solution@kevin-bates suggested to setup a shell wrapper that modifies the PATH before launching the kernel (details below). This works, but it is cumbersome and error-prone to setup, especially for non-experts and/or for multiple environments. Ideal solutionIdeally, we would like to create the kernel_spec in the usual way with with a new flag (like Details of solution proposed by @kevin-bates in jupyter/notebook#4527: Modify the kernel_spec to: Note that we specify the launcher wrapper The wrapper Finally, Note that this solution may not work on windows. EDIT: Replaced |
|
Alternative simpler solution: avoid the prepend script and just hard-code a This has the disadvantage that the PATH in the kernel does not adapt automatically to changes in the user's PATH. But it can also be an advantage for some use cases: it's more explicit and could improve reproducability. |
|
Has anyone got this running in a JupyterHub environment with DockerSpawner? |
Linking to a jupyter notebook issue which may be more appropriate here:
See jupyter/notebook#4527
Please advice on where you prefer to continue the discussion.
The text was updated successfully, but these errors were encountered: