mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
Merge pull request #29764 from lkxed/20230716-1-How-to-Install-Jupyter-Notebook-in-Debian-or-Ubuntu-Linux
[手动选题][tech]: 20230716.1 ⭐️⭐️ How to Install Jupyter Notebook in Debian or Ubuntu Linux.md
This commit is contained in:
commit
3924dcdc42
@ -0,0 +1,135 @@
|
||||
[#]: subject: "How to Install Jupyter Notebook in Debian or Ubuntu Linux"
|
||||
[#]: via: "https://www.debugpoint.com/install-jupyter-ubuntu/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Install Jupyter Notebook in Debian or Ubuntu Linux
|
||||
======
|
||||
|
||||
**A simple tutorial on how to install Jupyter Notebook in Ubuntu or Debian Linux.**
|
||||
|
||||
[Jupyter][1] Notebook is a powerful web-based interactive dev tool which allows you to create and share live code, visualizations, and interactive data. Its notebook format combines code and text, making it an excellent choice for data exploration, analysis, and collaborative projects.
|
||||
|
||||
In this tutorial, we will guide you through the step-by-step process of installing Jupyter Notebook on Ubuntu or Debian -based systems, enabling you to harness its versatility and extend your programming capabilities.
|
||||
|
||||
### Install pip
|
||||
|
||||
Before we begin, ensure that pip, the Python package installer, is installed on your system. If you already have pip installed, you can skip this step. Otherwise, follow these instructions to install it. You can also visit [this page][2] for detailed instructions.
|
||||
|
||||
Open a terminal window (Ctrl+Alt+T) and type the following command; press Enter:
|
||||
|
||||
```
|
||||
sudo apt updatesudo apt install python3-pip
|
||||
```
|
||||
|
||||
You may be prompted to enter your password. Provide it and wait for the installation to complete.
|
||||
|
||||
### Install virtualenv
|
||||
|
||||
Although not mandatory, it is recommended to isolate your work environment via this tool in the Jupyter Notebook installation. This ensures that any changes or packages you install will not interfere with your system’s Python environment. To set up a virtual env, follow the below steps:
|
||||
|
||||
In the terminal, enter the following command:
|
||||
|
||||
```
|
||||
sudo apt install python3-virtualenv
|
||||
```
|
||||
|
||||
Wait for the installation to finish. Once complete, proceed to the next step.
|
||||
|
||||
### Create a virtual environment
|
||||
|
||||
Creating a virtual environment is a straightforward process. Here’s how you can set up a new virtual environment specifically for Jupyter Notebook:
|
||||
|
||||
Navigate to the directory where you want to create the virtual environment. Run the following command in the terminal:
|
||||
|
||||
```
|
||||
virtualenv my-jupyter-env
|
||||
```
|
||||
|
||||
This command creates a new directory called “my-jupyter-env”, which will contain the virtual environment files.
|
||||
|
||||
![create jupyter environment][3]
|
||||
|
||||
You can also verify that the directory is created under your home folder via any file manager.
|
||||
|
||||
![jupyter env folders][4]
|
||||
|
||||
Activate the virtual environment by entering the following:
|
||||
|
||||
```
|
||||
source my-jupyter-env/bin/activate
|
||||
```
|
||||
|
||||
You will notice that your terminal prompt changes to indicate that you are now inside the virtual environment.
|
||||
|
||||
![activate the environment][5]
|
||||
|
||||
### Install Jupyter Notebook
|
||||
|
||||
With the virtual environment activated, you can now proceed to install Jupyter Notebook:
|
||||
|
||||
In the terminal, type the following command:
|
||||
|
||||
```
|
||||
pip install jupyter
|
||||
```
|
||||
|
||||
This command fetches the necessary packages and installs Jupyter Notebook in your virtual environment.
|
||||
|
||||
![Installing jupyter using pip][6]
|
||||
|
||||
### Launch Jupyter Notebook
|
||||
|
||||
Once the installation is complete, you are ready to launch Jupyter Notebook:
|
||||
|
||||
In the terminal, type the following command:
|
||||
|
||||
```
|
||||
jupyter notebook
|
||||
```
|
||||
|
||||
After executing the command, Jupyter Notebook will start, and you should see an output similar to this:
|
||||
|
||||
![running jupyter notebook in Debian][7]
|
||||
|
||||
Your default web browser will open, displaying the Jupyter Notebook interface.
|
||||
|
||||
![Jupyter notebook running in browser][8]
|
||||
|
||||
### Shutting down and restart
|
||||
|
||||
If you want to shutdown the Notebook server, make sure to close and save all notebooks. Close the browser. Then press “CTRL+C” in the terminal window. It will prompt you whether you want to shutdown the server. Type Yes and hit enter. And finally, close the terminal window.
|
||||
|
||||
To restart the server again, you need run all the commands from “virtualenv my-jupyter-env” as described above.
|
||||
|
||||
### Conclusion
|
||||
|
||||
Congratulations! You have successfully installed Jupyter Notebook on your Ubuntu or Debian system. By following the above steps, you can now take advantage of Jupyter’s interactive development environment to write code, create visualizations, and explore data effortlessly.
|
||||
|
||||
Remember, Jupyter Notebook supports various programming languages, including Python and offers a vast list of plugins to extend its functionality further.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/install-jupyter-ubuntu/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://jupyter.org/
|
||||
[2]: https://www.debugpoint.com/pip-command-not-found/
|
||||
[3]: https://www.debugpoint.com/wp-content/uploads/2023/07/create-jupyter-environment.jpg
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2023/07/jupyter-env-folders.jpg
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2023/07/active-the-environment.jpg
|
||||
[6]: https://www.debugpoint.com/wp-content/uploads/2023/07/Installing-jupyter-using-pip.jpg
|
||||
[7]: https://www.debugpoint.com/wp-content/uploads/2023/07/running-jupyter-notebook-in-Debian.jpg
|
||||
[8]: https://www.debugpoint.com/wp-content/uploads/2023/07/Jupyter-notebook-running-in-browser.jpg
|
Loading…
Reference in New Issue
Block a user