First, ensure WSL is enabled on your Windows machine. This feature lets you run a Linux distribution alongside your Windows system. Follow Microsoft’s instructions to enable it. Head to the Microsoft Store and install a Linux distribution, like Ubuntu. You’re free to choose any that fits your requirements.
After installing Linux, open the terminal and run these commands to update your system:
sudo apt update
sudo apt upgrade
Python isn’t pre-installed with WSL, so let’s fix that. Use this command to install Python and pip:
sudo apt install python3 python3-pip
Next, install Jupyter using pip:
pip3 install jupyter
Make launching Jupyter Notebook easier by setting up an alias. Run this command:
echo 'alias jupyter-notebook="~/.local/bin/jupyter-notebook --no-browser"' >> ~/.bashrc
Now, start Jupyter Notebook:
jupyter-notebook
When you run it for the first time, you’ll see a login screen. Head back to your WSL terminal, use the token provided to set your password.
To explore where Jupyter stores its configuration files and data, run the following command:
~/.local/bin/jupyter --path
And that’s it! With these straightforward steps, you can integrate Jupyter Notebook into their Windows environment using Windows Subsystem for Linux (WSL). Happy coding!