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
Add %mamba magic to install packages in current kernel #14075
Comments
This issue continues to come up for hub deployments with more complex environments. Just wanted to resurface a feature request for a %mamba magic. |
I wondered that too. This worked as a workaround:
|
A mamba magic would be great but what's the problem of just using |
According to the creator of IPython, directly calling the shell can result in unexpected behaviour with respect to which environment the packages are actually installed in. And see this SO post with more links/details. |
I think this was caused by the PATH environment is according to that one you open notebook instead of kernel, but that can be configured by kernelspec, I have a snippet for that: python -m ipykernel install --user --name $CONDA_DEFAULT_ENV --display-name "Python $(python-version) ($CONDA_DEFAULT_ENV)"
json_file="$HOME/.local/share/jupyter/kernels/$CONDA_DEFAULT_ENV/kernel.json"
# jq '. + {env: {PATH: env.PATH}}' $json_file > $json_file
cat <<< $(jq '. + {env: {PATH: env.PATH}}' $json_file) > $json_file I would like to crate a PR to add mamba magic but I doubt whether it will be accepted because there is a simple workaround (like this). |
OK! I think there is still value in a PR for |
Thanks @lizeidsness, though I'm not sure #14075 (comment) solves the underlying issue, as this should just run conda, not mamba, which offers improved performance over conda, esp for more complex environments. |
While we are considering this, it would also be great to have support for a I do realize, though, that at some point, you just have to say no to these requests. Not to mention, the folks behind |
Noted - but was meant as a temporary workaround until it was maybe implemented. |
|
Conda has two compatible alternative that are mamba and micromamba. In order for users to be able to use conda environment based on these two drop-in alternative, this patch implements two additional magic commands that makes them usable in the same fashion as conda. Fixes #14075
Originally posted by @jakevdp in #9517 (comment)
The text was updated successfully, but these errors were encountered: