mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
translated
This commit is contained in:
parent
3e20928bd9
commit
afb563403d
@ -1,135 +0,0 @@
|
||||
[#]: 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: "geekpi"
|
||||
[#]: 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
|
@ -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: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
如何在 Debian 或 Ubuntu Linux 中安装 Jupyter Notebook
|
||||
======
|
||||
|
||||
**有关如何在 Ubuntu 或 Debian Linux 中安装 Jupyter Notebook 的简单教程。**
|
||||
|
||||
[Jupyter][1] Notebook 是一款功能强大的基于 Web 的交互式开发工具,可让你创建和共享实时代码、可视化和交互式数据。其笔记本格式结合了代码和文本,使其成为数据探索、分析和协作项目的绝佳选择。
|
||||
|
||||
在本教程中,我们将逐步指导你在基于 Ubuntu 或 Debian 的系统上安装 Jupyter Notebook,使你能够利用其多功能性并扩展编程能力。
|
||||
|
||||
### 安装 pip
|
||||
|
||||
在开始之前,请确保你的系统上已安装 pip(Python 包安装程序)。如果你已经安装了 pip,则可以跳过此步骤。否则,请按照以下说明进行安装。你还可以访问[此页面][2]获取详细说明。
|
||||
|
||||
打开终端窗口 (Ctrl+Alt+T) 并输入以下命令,按回车键:
|
||||
|
||||
```
|
||||
sudo apt updatesudo apt install python3-pip
|
||||
```
|
||||
|
||||
系统可能会提示你输入密码。提供它并等待安装完成。
|
||||
|
||||
### 安装 virtualenv
|
||||
|
||||
尽管不是强制性的,但建议在 Jupyter Notebook 安装中通过此工具隔离你的工作环境。这可以确保你安装的任何更改或软件包都不会干扰系统的 Python 环境。要设置虚拟环境,请按照以下步骤操作:
|
||||
|
||||
在终端中,输入以下命令:
|
||||
|
||||
```
|
||||
sudo apt install python3-virtualenv
|
||||
```
|
||||
|
||||
等待安装完成。完成后,继续下一步。
|
||||
|
||||
### 创建虚拟环境
|
||||
|
||||
创建虚拟环境是一个简单的过程。以下是专门为 Jupyter Notebook 设置新虚拟环境的方法:
|
||||
|
||||
进入到要在其中创建虚拟环境的目录。在终端中运行以下命令:
|
||||
|
||||
```
|
||||
virtualenv my-jupyter-env
|
||||
```
|
||||
|
||||
此命令创建一个名为 “my-jupyter-env” 的新目录,其中将包含虚拟环境文件。
|
||||
|
||||
![create jupyter environment][3]
|
||||
|
||||
你还可以通过任何文件管理器验证该目录是否在你的主文件夹下创建。
|
||||
|
||||
![jupyter env folders][4]
|
||||
|
||||
输入以下命令激活虚拟环境:
|
||||
|
||||
```
|
||||
source my-jupyter-env/bin/activate
|
||||
```
|
||||
|
||||
你会注意到终端提示符发生变化,表明你现在位于虚拟环境中。
|
||||
|
||||
![activate the environment][5]
|
||||
|
||||
### 安装 Jupyter Notebook
|
||||
|
||||
激活虚拟环境后,你现在可以继续安装 Jupyter Notebook:
|
||||
|
||||
在终端中,输入以下命令:
|
||||
|
||||
```
|
||||
pip install jupyter
|
||||
```
|
||||
|
||||
此命令会获取必要的包并在虚拟环境中安装 Jupyter Notebook。
|
||||
|
||||
![Installing jupyter using pip][6]
|
||||
|
||||
### 启动 Jupyter Notebook
|
||||
|
||||
安装完成后,你就可以启动 Jupyter Notebook:
|
||||
|
||||
在终端中,输入以下命令:
|
||||
|
||||
```
|
||||
jupyter notebook
|
||||
```
|
||||
|
||||
执行命令后,Jupyter Notebook 将启动,你应该看到类似于以下内容的输出:
|
||||
|
||||
![running jupyter notebook in Debian][7]
|
||||
|
||||
你的默认 Web 浏览器将打开,显示 Jupyter Notebook 界面。
|
||||
|
||||
![Jupyter notebook running in browser][8]
|
||||
|
||||
### 关闭并重新启动
|
||||
|
||||
如果要关闭 Notebook 服务器,请确保关闭并保存所有笔记。关闭浏览器。然后在终端窗口中按 “CTRL+C”。它会提示你是否要关闭服务器。输入 Yes 并按回车键。最后,关闭终端窗口。
|
||||
|
||||
要再次重新启动服务器,你需要按上面的描述运行 “virtualenv my-jupyter-env” 等所有命令
|
||||
|
||||
### 总结
|
||||
|
||||
恭喜! 你已在 Ubuntu 或 Debian 系统上成功安装 Jupyter Notebook。通过执行上述步骤,你现在可以利用 Jupyter 的交互式开发环境轻松编写代码、创建可视化并探索数据。
|
||||
|
||||
请记住,Jupyter Notebook 支持各种编程语言,包括 Python,并提供大量插件来进一步扩展其功能。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/install-jupyter-ubuntu/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者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