Python全系列 教程
3567个小节阅读:5931k
目录
鸿蒙应用开发
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
Jupyter Notebook是基于网页的用于交互计算的应用程序。其可被应用于全过程计算:开发、文档编写、运行代码和展示结果
简而言之,Jupyter Notebook是以网页的形式打开,可以在网页页面中直接编写代码和运行代码,代码的运行结果也会直接在代码块下显示
如在编程过程中需要编写说明文档,可在同一个页面中直接编写,便于作及时的说明和解释
文档:The Jupyter Notebook — Jupyter Notebook 6.4.8 documentation (jupyter-notebook.readthedocs.io)
提示
Anaconda完整版已经默认安装,Miniconda没有安装
如果没有自动安装,那么就在Shell中输入以下命令安装:
xxxxxxxxxx
conda install jupyter notebook
xxxxxxxxxx
pip install jupyter
注意
老版本的pip在安装Jupyter Notebook过程中或面临依赖项无法同步安装的问题。因此需要先把pip升级到最新版本。
xxxxxxxxxx
pip install --upgrade pip
xxxxxxxxxx
jupyter notebook
执行命令之后,在终端中将会显示一系列notebook的服务器信息,同时浏览器将会自动启动Jupyter Notebook。
启动过程中终端显示内容如下:
xxxxxxxxxx
$ jupyter notebook
[I 08:58:24.417 NotebookApp] Serving notebooks from local directory: /Users/catherine
[I 08:58:24.417 NotebookApp] 0 active kernels
[I 08:58:24.417 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 08:58:24.417 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
注意
之后在Jupyter Notebook的所有操作,都请保持终端不要关闭,因为一旦关闭终端,就会断开与本地服务器的链接,将无法在Jupyter Notebook中进行其他操作
浏览器地址栏中默认地将会显示:http://localhost:8888
。其中,“localhost”指的是本机,“8888”则是端口号。
如果同时**启动了多个Jupyter Notebook,由于默认端口“8888”被占用,因此地址栏中的数字将从“8888”起,每多启动一个Jupyter Notebook数字就加1,如“8889”、“8890”……
如果想自定义端口号来启动Jupyter Notebook,可以在终端中输入以下命令:
xxxxxxxxxx
# jupyter notebook --port <port_number>
jupyter notebook --port 9999
实时学习反馈
1. 关于Jupyter Notebook说法错误的是?
A Jupyter Notebook是一款基于网页的用于交互计算的应用程序
B Jupyter Notebook默认的端口号是8888
C Jupyter Notebook可以通过--port
参数修改端口号
D Jupyter Notebook开启后可以直接退出命令行
答案
1=>D