I created almost all my Sagemath notebooks as SageMath 9.7; they all have SageMath 9.7 on the right-corner of the menu bar. I noticed that sometimes, when I reload a Sagemath notebook, it will have Python3 (ipykernel) appear in the right-hand corner of the menubar. Some commands such as reset() and display latex are not recognized any more.
If I redo the file as SageMath 9.7; then it will work. How to prevent Sagemath from switching the type of
the original file ?
Related
Let's say that you have two windows open in VS Code, one is a Jupyter notebook, and the other is the Python interactive window. Both are running the same kernel. Is there a way to link these two windows, so when cells are run in the notebook, the interactive window will know about the resulting variables?
I'm aware that VS Code has a Python code format that can be linked to the interactive window, and that Jupyter notebooks can be converted into this format. Is it possible to directly link a Jupyter notebook to the interactive window without first doing this conversion?
With JupyterLab the is accomplished with the New Console for Notebook command.
I'm trying to use the terminal to run a jupyter notebook (kernel: Julia v1.6.2), which contains generated using Plots.jl, before uploading the notebook to github for viewing on nbviewer.com.
Following this question:
How to run an .ipynb Jupyter Notebook from terminal?
I have been using nbconvert as follows:
jupyter nbconvert --execute --to notebook --inplace
This runs the notebook (if you tweak the timeout limits), however, it does not display plots when using Plots.jl, even when I explicitly call display(plot()) at the end of a cell.
Does anyone have any idea how notebooks can be run remotely in such a manner that plots will be generated and displayed, particularly when using Julia?
I managed to generate Plots.jl plots by getting from IJulia the same configuration it uses to run notebooks (this is probably the most sure way when you have many Pyhtons etc.).
using Conda, IJulia
Conda.add("nbconvert") # I made sure nbconvert is installed
mycmd = IJulia.find_jupyter_subcommand("nbconvert")
append!(mycmd.exec, ["--ExecutePreprocessor.timeout=600","--to", "notebook" ,"--execute", "note1.ipynb"])
Now mycmd has exactly the same environment as seen by IJulia so we can do run(mycmd):
julia> run(mycmd)
[NbConvertApp] Converting notebook note1.ipynb to notebook
Starting kernel event loops.
[NbConvertApp] Writing 23722 bytes to note1.nbconvert.ipynb
The outcome got saved to note1.nbconvert.ipynb, I open it with nteract to show that graphs actually got generated:
Launch notebook with using IJulia and notebook() in the REPL
I added kernels for Julia and Haskell in Jupyter lab, however the filename extension for which is still ipynb, and I really like to distinguish them from IPython notebook.
I renamed them as *.ijlnb or *.ihsnb however Jupyter lab no longer recognizes them as notebooks but a plain text.
How to assosiate .ijlnb or .ihsnb file to Jupyter?
My jupytr notebook won't output any of my gig-lot objects no matter what I do. I've restarted the kernel, jupytr notebook, Anaconda Navigator, and my computer and nothing seems to help. I've tried opening new notebooks and reformatting but nothing is working.
I'm trying to change the default working directory for Jupyter notebooks (anaconda installation). I've looked up many different answers, most of which focus on changing the jupyter_notebook_config.py file, but none of those work.
Some of the things i've tried:
This medium article
This github issue (bottom reply)
This
This too
No matter what I try, whenever I start jupyter notebook the directory I see is C:\Users\me.
I admit part of the problem is that I'm not great with command line things which makes some of the answers difficult to understand.
If you run the Jupyter Notebook from the Windows Start Menu then you have to change the command running Jupyter Notebook in the shortcut. Right click on the Start Menu on the shortcut, open file location, right click on the Jupyter Notebook shortcut, select Properties, and in the Terget Textbox, change the "%USERPROFILE%" part in what you wand or if you have changed the Jupyter config file, delete this part.