-
Notifications
You must be signed in to change notification settings - Fork 391
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
Wrong kernel for R files #120
Comments
Hello @kiendang , thanks for reporting. And it's great to know that people are also using Jupytext for R files ! Jupyter always sets the default kernel when none is present in the document, as currently Jupytext does not set up any kernel by itself. I agree that it would be better if Jupytext could search for a kernel with the matching language... I will investigate this when time permits (please leave the issue open till that). If you knew, in python, how to get an enumeration of available kernels, that would be a great start already. I have another side remark: I see that your metadata filter excludes all the notebook metadata. Is that done on purpose? Note that, if you wanted to remove the filter on notebook metadata, you could temporarily prepare the R kernel yourself by appending the YAML representation for your kernel. You will obtain that representation by just replacing |
Thanks for the response! After thinking a bit more about this, I realize this might not be that big of an issue. I have multiple python kernels for different virtualenvs. So most of the time I have to manually set the correct kernel anyway. That said it would be nice if I would be happy to help with this. Actually I did try to solve this first before opening the issue but didn't know where to start. I will try your suggestion. I guess the aim is to get an enumeration of available kernels then for each extension find the first kernel on the list with the correct language? Yes the metadata thing is on purpose. I usually use |
You're welcome! Thanks for your answers as well, that's very interesting for me to better know how people are using the tool. I see that one can list all the Jupyter kernels in bash with jupyter kernelspec list. The corresponding Python module seems to be jupyter_kernel.kernelspec. I did a quick experiment with the module, which indeed provides the list of kernels, and the information on the language. What is needed now is to find how one builds the from jupyter_client import kernelspec
kernelspec.find_kernel_specs()
py3 = kernelspec.get_kernel_spec('python3')
py3.language
py3.to_dict()
|
KeyError seen on CI: https://travis-ci.com/mwouts/jupytext/jobs/158053471
KeyError seen on CI: https://travis-ci.com/mwouts/jupytext/jobs/158053471
Hello @kiendang , the latest release (0.8.5) provides an implementation for this. I have tested it locally with both |
Great! Thanks a lot! I'll check it out. |
Issue
I'm not sure whether this is a
jupyter
orjupytext
problem butjupyter
doesn't set the correct kernel for.R
files for me.Steps to reproduce:
.R
fileProblem
The kernel is set to the default kernel
python3
, not the one forR
.I have to change the kernel to
R
manually. This is the metadata after setting the correct kernel:Is it possible to automatically use the
R
kernel for.R
files?The text was updated successfully, but these errors were encountered: