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

Support for using python/jupyter within chroot-environment #318

Open
moritzschaefer opened this issue Mar 23, 2021 · 4 comments
Open

Support for using python/jupyter within chroot-environment #318

moritzschaefer opened this issue Mar 23, 2021 · 4 comments

Comments

@moritzschaefer
Copy link

I use a (i)python-executable (and conda-environment) from within a chroot environment.

Starting the chroot is wrapped in the conda-shell-script, so setting the emacs-variable shell-explicit-file-name is enough to go a shell with access to my desired python and conda when I run shell.

However I have not yet found a way to configure which executable to use for emacs-jupyter.

It would be nice to be able to configure the python-binary that is used for launching kernels etc. That way, I could write/use a wrapper script that starts my chroot and uses the appropriate python from within that environment.

Are there any plans to make this possible?

@fleimgruber
Copy link

#317 seems related.

@nnicandro
Copy link
Collaborator

Would #341 solve this problem? It would allow you to specify the Jupyter command to use. Also wouldn't kernelspecs be a solution? Define a kernelspec that uses a shell script which sets up the appropriate environment and then launches a python kernel, see for example https://www.rc.virginia.edu/userinfo/howtos/rivanna/custom-jupyter-kernels/.

@indigoviolet
Copy link

See #387 for some related discussion

@Uriziel47
Copy link

Uriziel47 commented Apr 18, 2022

Would #341 solve this problem? It would allow you to specify the Jupyter command to use. Also wouldn't kernelspecs be a solution? Define a kernelspec that uses a shell script which sets up the appropriate environment and then launches a python kernel, see for example https://www.rc.virginia.edu/userinfo/howtos/rivanna/custom-jupyter-kernels/.

I don't know if it works with chroot-environment (never heard of it). But here is how I am using this fantastic package with the PR #341.

I am using the change given in #341 with jupyter in a virtual environnment. My setting in init.el is:
(setq jupyter-command-directory "~/.virtualenvs/jupyter/bin")

And in the org file I do have a setup section with a property line sth. like:
`* Setup :noexport:
Setup for using the right kernel etc.

#+property: header-args:jupyter-python :session /home/work/.local/share/jupyter/runtime/kernel-bezier.json

Start the kernel. We use a connection file and a specific /terminal/ so we can kill the
kernel. Sadly to get the /org-notebook/ to work again you also have to kill the
/jupyter-repl-.../ buffer.

#+begin_src sh
workon jupyter
jupyter kernelspec list
jupyter kernel --kernel='poetry-learn-scientific' --KernelManager.connection_file='/home/work/.local/share/jupyter/runtime/kernel-bezier.json'
#+end_src
`
These commands, for the terminal, are meant to be an advice. Change them as you need!

I do hope this or a similar workflow also works in your case.

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

5 participants