how to add julia kernel in sage notebook for windows?I have sagemath installed on windows but I can't install the kernel to use julia.
Related
I have installed jupyter notebook for my windows10
and I want to add the kernel of SageMath and to use it in VScode
is it possible to connect it?
Has anyone had a problem running julia from a jupyter notebook?
I have looked at how-to pages like this one and this one, which all pretty much recommend the same series of steps:
Open the terminal, launch Julia, and Pkg.add("IJulia").
I follow this step and got the following output
Resolving package versions...
Updating `~/.julia/environments/v1.7/Project.toml`
[7073ff75] + IJulia v1.23.3
Updating `~/.julia/environments/v1.7/Manifest.toml`
[7073ff75] + IJulia v1.23.3
[b85f4697] + SoftGlobalScope v1.1.0
[c2297ded] + ZMQ v1.2.1
[8f1865be] + ZeroMQ_jll v4.3.4+0
[a9144af2] + libsodium_jll v1.0.20+0
Launch a Jupyter session and choose a Julia kernel.
I'm able to launch a Jupyter session. However, when I click new, all my option are Python kernels. I don't see anywhere to launch a Julia kernel.
Has anyone run into a similar problem??
I am running macOS Monterey, version 12.4, Apple M1 Max Chip.
My julia is 1.7.2
Try a different step 2:
julia> using IJulia
julia> notebook()
This should open Jupyter in a new browser/tab window. Do you see the Julia kernel in this window? (In which case you might just have different Jupyter versions installed on your system).
you're probably using a jupyter notebook that didn't come with IJulia, thus, you will have to install a kernel spec (a JSON file) so the jupyter knows where to find Julia kernel.
Try following:
https://julialang.github.io/IJulia.jl/stable/manual/installation/#Installing-IJulia
More specifically,
You can force it to use a specific jupyter installation by setting ENV["JUPYTER"] to the path of the jupyter program before running Pkg.build("IJulia")
That's probably because the Jupyter notebook you have installed doesn't have IJulia installed. You will have to load IJulia to access Jupyter with a Julia kernel to fix that.
julia> using IJulia
julia> notebook()
I had the same problem which was the result of having an older version of Jupyter. I solved it by uninstalling and reinstalling the latest jupyter, then added the R and Julia kernels from thw official R, through R Studio, and Julia sites respectively where each kernel installation did not take more than 2 minutes and all work well.
Good luck
EK
I have jupyter notebook installed, I also have R installed. Both work fine independently.
When I run jupyter with jupyter notebook, then try to open an ipynb file, I see
The only option in the dropdown is Python 3 (R is not an option).
Question
How do you open a jupyter notebook with an R kernel (on mac)?
Note
I tried jupyter notebook --runtime-dir /usr/local/bin/R but that was just guessing
Looks like the R kernel could be installed via pip?
Open any R session (e.g. in RStudio is fine, or open terminal/bash and type R to start an R session).
Install the kernel with:
install.packages("devtools")
devtools::install_github("IRkernel/IRkernel")
IRkernel::installspec()
Close and reopen the notebook and the R kernel will now be available.
If the R kernel does not appear as an option within a Jupyter notebook even after installing R, and one is using Anaconda, bringing up the conda prompt from the Start menu (Windows 10), and running the following commands may do the trick:
conda config --add channels r
conda install --yes r-irkernel
Credit to this post.
I recently installed the Anaconda3 distribution and I want to have the R and Julia Kernels available besides Python. I use windows 10.
To install IJulia I installed the Julia language and follewed the steps indicated in the IJulia page; everything went fine.
To install the R kernel I used the command conda install -c r r-essentials in the anaconda command prompt, again, no problems. I also installed R.
When I launch the notebook the only available kernel is Python, the R and Julia kernels doesn't appear in the list, I have no clue why this since I got no errors in the installation of IJulia and IRKernel. Anyone could help?
After a fresh installation of Anaconda Distribution (either 2 or 3), following steps should be performed to achieve the desired kernels (R & Julia) on your notebook.
To install R on Anaconda(2/3) Jupyter Notebook :
Open 'Anaconda Command Prompt' & execute conda update notebook to update your Jupyter notebook to the most recent version.
Then install IRkernel by conda install -c r notebook r-irkernel
Now you may open R in your command prompt by running R.exe
Install all necessary R packages using the following lines in the R console by executing :
install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ',
'devtools', 'uuid', 'digest'))
devtools::install_github('IRkernel/IRkernel')
Finally, make the R kernel available to your Jupyter Notebook by executing:
Install only for the current user ➡ IRkernel::installspec()
For System-wide installation(all Users) ➡ IRkernel::installspec(user = FALSE)
To install Julia on Anaconda(2/3) Jupyter Notebook :
First, download Julia version 0.4 or later and run the installer. Then run the Julia application (double-click on it); the Julia Console with a julia> prompt will appear.
Now, for the most important step, open 'Anaconda Command Prompt' & execute where jupyter to see the actual path of your Jupyter Notebook. The output will be something like "C:\Users\JohnDoe\AppData\Local\Continuum\Anaconda3\bin\jupyter.exe"
Copy the above location and go to your Julia console. Now, execute the following respectively:
ENV["JUPYTER"]="C:\\Users\\JohnDoe\\AppData\\Local\\Continuum\\Anaconda3\\bin\\jupyter.exe"
Pkg.add("IJulia")
Pkg.build("IJulia") (Optional, execute if further error occurs again.)
⬆ Notice that the backslashes have to be doubled when you type them as a Julia string. I've just assumed that the path is your Anaconda path with \bin\jupyter appended, but replace that with whatever where jupyter tells you.
After few minutes, in Julia console execute:
using IJulia
notebook()
Now, you can program Julia in your Anaconda Jupyter Notebook.
Excellent, it worked.
However, it is important to import the package first before adding it.
import Pkg; Pkg.add("IJulia")
I installed the 0.4-pre Julia kernel on a mac, which goes into
/Applications/Julia-0.4.0-pre-349a4e1977.app/Contents/Resources/julia/bin/julia
and set the symbolic link to this kernel
ln -s /Applications/Julia-0.4.0-pre-349a4e1977.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia
but in my IPython notebook, aka Jupiter, the 0.3.10 starts up when
ipython notebook --profile=julia
How to include the 0.4-pre kernel option in the IPython notebook?
If you have IPython/Jupyter version 3 or above, then you should start it with
ipython notebook
without the
--profile julia
You need to Pkg.add("IPython") and Pkg.build("IPython") in 0.4 to add the 0.4 kernel spec to Jupyter. This is similar to the instructions for when you update Julia here.
Thanks for the answers. Using the info from #ARM and #David P. Sanders, what eventually worked for me on a mac was:
Run the downloaded julia 0.4-pre in a Terminal: exec '/Applications/Julia-0.4.0-pre-349a4e1977.app/Contents/Resources/julia/bin/julia', which gives me a Julia prompt.
At this Julia prompt run Pkg.add("IJulia"), which creates a ~/.julia/v0.4 directory and installs IJulia and a few other packages in that directory.
quit() from this julia prompt.
Navigate to the directory in the Terminal where your myNotebook.ipynb's are or where you want to create them and run ipython notebook at the Terminal prompt, which should open a webpage on localhost:8888 with that directory's files listed. Click on the file you want edit.