Edit: See Spyder Notebook Plugin... https://github.com/spyder-ide/spyder-notebook
I would like to load a Jupyter notebook into Spyder and activate the current Jupyter Python kernel in an Spyder Ipython console. I was hoping this would allow me to use the Spyder editor, console and variable explorer whilst developing in Jupyter. Using the code below in Jupyter, I have been able to load up a converted notebook. In addition, I can open the current kernel in a new console manually. However, the variable explorer doesn't display variables from the connected console.
I would like to:
1) From Jupyter, automatically open the current Jupyter kernel in the Spyder IPython Console
2) Get the Spyder variable explorer to work with a connected kernel
Any ideas? Does anyone have a better method than that listed below?
%%javascript var nb = IPython.notebook; var kernel = IPython.notebook.kernel; var commandFileName = "theNotebook = " + "'"+ nb.notebook_path +"'"; kernel.execute(commandFileName);
get_ipython().system('jupyter nbconvert --to script "' + theNotebook + '"')
get_ipython().system('spyder "' + theNotebook.replace('.ipynb', '.py') + '"')
import ipykernel print("Copy and paste this into Spyder diaolgue box:\nConsoles~'Connect to an existing kernel':\n") print(ipykernel.connect.get_connection_file())
You can also open any Jupyter Notebook inside Spyder. For this go to the options menu at the top right of the pane and click Open, which will allow you to look for ipynb files in your computer. Click any notebook that you want to open inside Spyder and you will be able to see it as a new tab in the Notebook pane.
Project description This package allows the Jupyter notebook to run inside Spyder as a plugin.
Double-click on the Jupyter Notebook desktop launcher (icon shows [IPy]) to start the Jupyter Notebook App. The notebook interface will appear in a new browser window or tab. A secondary terminal window (used only for error logging and for shut down) will be also opened.
A code ran in jupyter is ran through the python interpreter, the same interpreter that pycharm or spyder would use and hence there is no reason why jupyter would run faster.
(Spyder developer here) This will be solved once we make our own Notebook plugin to start Spyder kernels.
We're working right now to release a first version of that plugin with good desktop integration. Then we'll proceed to integrate it with the other Spyder plugins (such as the Variable Explorer) and for that we need to make the notebook to start Spyder kernels.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With