Jupyter Notebook is the most popular server-client application that allows you to write, run, test, and debug Python-interpreted programs on notebook documents via a web browser.
$ sudo apt install nodejs npm python3 python3-pip #For Debian, Ubuntu, Linux Mint, etc. $ sudo dnf install nodejs python3 python3-pip #For RHEL, Fedora, Alma Linux, etc. $ sudo pacman -S nodejs npm python python-pip #For Arch, Manjaro, EndeavourOS, etc.
2. Once the installation is finished, verify that each of these has been successfully installed and is accessible from the command-line.
$ nodejs -v $ npm -v $ python3 --version $ pip --version
3. Next, you need to install the Jupyter Notebook by executing the following command:
$ pip install jupyter
5. Finally, execute the “
After successfully completing all the previously mentioned steps, you can execute the following command to launch Jupyter Lab (or Jupyter Notebook, whichever you prefer).
$ jupyter-lab #OR $ jupyter notebook
Output of the “Jupyter Lab“:
In Jupyter Notebooks, “magic commands” are special commands that are not a part of the Python language itself but provide additional functionality and control within the Jupyter environment.
In Jupyter, it starts with either a single “
%” character for line magic (applied to a single line) or “
%%” for cell magic (applied to the entire cell).
%%js” or “
console.log()“, will be displayed in the browser’s console instead of below the cell.
Now, don’t be disheartened, as magic commands also act as the shebang “
With this method, you can also use your favorite NPM-installed packages in your Jupyter notebook (however, it is quite irritating).
Now, let’s end this article here.
So, I hope you find this article useful. If you have any questions or queries related to the topic, feel free to tell us via the comment section.
Till then, peace!