Use multiple kernels in the same Jupyter notebook - python

Can I use multiple kernels in the same Jupyter notebook, such as I can choose specific code-block to run with specific kernel version?
Example:
I want to have two code blocks in the same notebook file(.inypb), one of them has Python 2.7 code and other code block has Python 3.0 code, both of them should run against its own kernel version.

This SOS Polyglot Notebook extension for Jupyter should allow you to use multiple kernels in the same Jupyter notebook: https://github.com/vatlab/jupyterlab-sos

Related

Why my jupyter kernel is not visible in vs code jupyter extension?

I have my pyspark kernel installed using sparkmgic, it is showing in jupyter notebook and worked fine (connected to remote livy service and ran code without any issues). It is also visible when I use jupyter kernelspec list command, but when I tried to use vs code jupyter extension, it is not showing in the kernel list.
What is the reason it could be? how to fix it?
Thanks!
https://github.com/microsoft/vscode-jupyter/issues/8286
Got the answer from the one of code contributors on Github.
Just need to put python full path in the kernel configuration json file.

Jupyter Notebook creates a .txt file - and doesn't let me save as .ipynb. Manually creating a .ipynb file doens't open a jupyter notebook

I'm trying to move my data science Environment to VSCODE, it seems a really powerfull IDE to deal with multiple languages and with great versatility,
But currently I'm dealing with an annoying issue with the python and jupyter extension,
Expected behaviour
Using command palette 'Jupyter: Create blank new Jupyter notebook' it should open a .ipynb file with all the features of a jupyter notebook.
(source: https://code.visualstudio.com/docs/datascience/jupyter-notebooks)
Actual behaviour
Using command palette 'Jupyter: Create new blank notebook' it opens a jupyter notebook with all the features and the proper jupyter notebook layout, but with extension .txt.
I tried to save it as .ipynb but returns and error and don't let me save it.
When I create a file manually with 'filename.ipynb' it creates a file with the jupyter icon, but without all the features of a jupyter notebook.. it is a simple plain script file like a .py file.
I already have done a lot of web search looking for some solution, but without success.
already tried reinstall vscode and downgrade some versions of the python and jupyter extensions, but all without success.
Any help to solve this would be appreciated.
Environment data
VS Code version: 1.59.0
Extension version : Python v2021.8.1105858891, Jupyter v2021.8.1195043623
OS and version: Windows 10 64bit
Python version : Python 3.9.6 64bit

Vs Code Not Loading Jupyter Notebook Images

I love the way vs code works with jupyter notebooks and WSL 2. However, the only thing stopping me from switching completely is the lack of image rendering from a distributed notebook. When I download a notebook from class, there are sometimes important images displaying flowcharts, diagrams, etc and these do not load on vs code but they do on Anaconda using jupyter notebook there. Any ideas?
Vs Code Jupyter Notebook
anaconda jupyter notebook loaded

Jupyter Notebooks in VS Code using WSL 2 are not working

I want to use Jupyter Notebooks inside VS Code running within WSL 2. Regular Python works within WSL without a problem, that means the base conda enviroment is connected and I can run .py files. Moreover, I’m able to run the command jupyter notebook which will start the notebook server within WSL exposing the localhost to the Windows system.
However, I want to test the new Jupyter Notebook feature within VS Code, which is not working for me; VS Code shows: Jupyter Server: No Kernel and Python: Not Started (see screenshot below).
My testing machine is:
WSL 2 (using Pengwin distribution) on Windows 20H1 (19041.21)
VS Code 1.41 (having the Python extension installed)
Anaconda
What I did:
Open WSL
Open VS Code in my target directory (code .)
Create a new Notebook file from the command palette Python: Create New Blank Jupyter Notebook
Create dummy print("test")
Run Cell will trigger the warning:
Is there anything I’m missing?
The VS Code insiders actually works out of box with Jupyter notebooks. Just remember to run code-insiders . instead of code ..
Another solution would be, according to this website, start the VS Code in windows, then use WSL 2 as a remote server.
The code installation on wsl2 needs a restart to work properly, I was told by a notification, and in the question's comments you may see people experiencing the same issue(' it's working now. not sure why'). So before looking upon any elaborate solution, just restart code.

graphs from Altair are not displaying

On Ubuntu x64, I just freshly installed Anaconda 3.
I then installed altair via conda per these directions. Then I run the example code:
from altair import *
population = load_dataset('population')
Chart(population).mark_bar().encode(
x='sum(people)',
).transform_data(filter="datum.year==2000")
The code runs, but nothing happens. I expected a page would open in the browser perhaps, like bokeh does. To be safe, I also ran jupyter notebook in the background and re-running the code - no difference.
Please let me know if there's more information you need about my environment.
Thanks to #cel, I found out the code cannot be run in the iPython console from Anaconda - it needs to be run from a Jupyter notebook.
You have to run jupyter notebook in the terminal, then create a new iPython Notebook. Once the notebook is created, you can run your code interactively from the notebook.

Categories

Resources