-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix conda hook to work in both terminal and Jupyter Notebook #2047
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
Conversation
|
I tested it this way: In both the terminal and inside Jupyter notebook the result is the same: I then tested it with |
|
But having But people open new Jupyter Terminals in the Web UI, meaning these inline bash functions are lost. This practically means that we will have to
I also don't think
|
|
I have no idea what's going on with the test here. |
|
Also tested the recipe: |
|
@mathbunnyru I think the issue can be considered resolved as soon as
P.S.: I have added an order of precedence (i.e. numbering) for startup hooks: b-data/jupyterlab-python-docker-stack@82da8b4 |
As a developer, I would like to agree - it seems to work, easy to implement and to change for a custom environment. Order of precedence is a nice idea. Should I call the file something like |
That's what issue #2043 is about.
Yes, of course. And this is really nice to have. Great job. |
|
Renamed to |
|
This PR should also resolve issue #1792. |
Wow, that's a great catch, it definitely should 👍 Tests seem to pass, so longer sleep probably helped. |
|
@mathbunnyru LGTM and should work as intended.
I assume |
|
Starting the container with
|
|
@mathbunnyru With the current mechanism: Is it really a good idea that the custom environment is activated by default? Notebook/Console: 'Python 3 (ipykernel)' and 'python310' (from the recipe) are then identical (i.e. python310). IMHO The Terminal should also default to base even though a custom (conda) environment is made available. |
|
P.S.: I am not the right person to talk to when it comes to Conda envs. |
I think I can comment this code with some information. |
|
|
Please check Is this expected? Cross reference: ipython/ipykernel#416 |
I checked with commented activation (as it is now in the PR).
This snippet works for default Notebook/Console and doesn't work for py310 versions (and it shouldn't work). I also checked that python3.11 packages are not leaking somehow to |
All fine; Agreed.
Yes. And the Jupyter Docker Stacks project is not supposed to fix IPython. But I am quite sure people will complain that the custom (conda) environment is not activated when running the Notebook/Console with its kernel. |
|
Nice, thanks for your help ❤️ I'll merge this when the tests pass. |
Describe your changes
This makes conda env activate correctly for the whole process, not just the terminals.
I think it is reasonable and desirable to have the same environment inside a terminal and a Jupyter Notebook.
Issue ticket if applicable
Fix: #2043
Fix: #1792
Checklist (especially for first-time contributors)