Project Jupyter | Installing Jupyter
有三个产品
Jupyter是一个开源计算工具,支持多种编程语言,用于创建和共享文档,包括代码、方程式等。而Notebook则是 Jupyter 的一种应用程序,它为用户提供了一个交互式的环境,可以在其中编辑、运行、存储和共享 Jupyter 笔记本。
因此,Jupyter 和 Notebook 的关系是,Jupyter 是一个支持多种编程语言的开源计算工具,而 Notebook 则是其中的一个应用程序,提供了一个交互式环境,用于编辑和运行 Jupyter 笔记本。同时,Jupyter 还支持其他应用程序,如 JupyterLab 等。
pip install notebook
(d:\condaPythonEnvs\pyside6) PS D:\repos\PythonLearn> pip install notebook
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting notebook
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/db/40/2d321ba572dc9a94a090d92c9826291a1dcee1e05bc6c1d641ce419b701d/notebook-6.5.2-py3-none-any.whl (439 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 439.1/439.1 kB 1.7 MB/s eta 0:00:00
...
检查安装情况:
上述代码是再conda创建的环境(pyside6)中使用pip安装
可以使用conda list
列出包的变化;使用pip list
也可以
pip list|sls jupyter
(d:\condaPythonEnvs\pyside6) PS D:\repos\PythonLearn> conda list
# packages in environment at d:\condaPythonEnvs\pyside6:
#
# Name Version Build Channel
...
idna 3.4 pypi_0 pypi
ipykernel 6.20.1 pypi_0 pypi
ipython 8.8.0 pypi_0 pypi
ipython-genutils 0.2.0 pypi_0 pypi
isoduration 20.11.0 pypi_0 pypi
jedi 0.18.2 pypi_0 pypi
jinja2 3.1.2 pypi_0 pypi
jsonpointer 2.3 pypi_0 pypi
jsonschema 4.17.3 pypi_0 pypi
jupyter-client 7.4.9 pypi_0 pypi
jupyter-core 5.1.3 pypi_0 pypi
jupyter-events 0.6.3 pypi_0 pypi
jupyter-server 2.1.0 pypi_0 pypi
jupyter-server-terminals 0.4.4 pypi_0 pypi
jupyterlab-pygments 0.2.2 pypi_0 pypi
libffi 3.4.2 hd77b12b_6 defaults
markupsafe 2.1.1 pypi_0 pypi
matplotlib-inline 0.1.6 pypi_0 pypi
....
(d:\condaPythonEnvs\pyside6) PS D:\repos\PythonLearn> pip list
Package Version
------------------------ -----------
anyio 3.6.2
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
arrow 1.2.3
asttokens 2.2.1
attrs 22.2.0
autopep8 2.0.1
backcall 0.2.0
beautifulsoup4 4.11.1
bleach 5.0.1
certifi 2022.12.7
cffi 1.15.1
colorama 0.4.6
comm 0.1.2
debugpy 1.6.5
decorator 5.1.1
defusedxml 0.7.1
entrypoints 0.4
executing 1.2.0
fastjsonschema 2.16.2
fqdn 1.5.1
idna 3.4
ipykernel 6.20.1
ipython 8.8.0
ipython-genutils 0.2.0
isoduration 20.11.0
jedi 0.18.2
Jinja2 3.1.2
jsonpointer 2.3
jsonschema 4.17.3
jupyter_client 7.4.9
jupyter_core 5.1.3
jupyter-events 0.6.3
jupyter_server 2.1.0
jupyter_server_terminals 0.4.4
jupyterlab-pygments 0.2.2
版本信息:
PS C:\Users\cxxu\Desktop> jupyter --version
Selected Jupyter core packages...
IPython : 8.8.0
ipykernel : 6.20.1
ipywidgets : not installed
jupyter_client : 7.4.9
jupyter_core : 5.1.3
jupyter_server : 2.1.0
jupyterlab : not installed
nbclient : 0.7.2
nbconvert : 7.2.7
nbformat : 5.7.3
notebook : 6.5.2
qtconsole : not installed
traitlets : 5.8.1
本地帮助文档:
(base) PS D:\repos\PythonLearn> jupyter -h
usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir] [--paths] [--json] [--debug] [subcommand]
Jupyter: Interactive Computing
positional arguments:
subcommand the subcommand to launch
optional arguments:
-h, --help show this help message and exit
--version show the versions of core jupyter packages and exit
--config-dir show Jupyter config dir
--data-dir show Jupyter data dir
--runtime-dir show Jupyter runtime dir
--paths show all Jupyter paths. Add --json for machine-readable format.
--json output paths as machine-readable json
--debug output debug information about paths
Available subcommands: bundlerextension dejavu events execute kernel kernelspec migrate nbclassic nbconvert nbextension notebook run server serverextension
troubleshoot trust
常用的部分高亮:
bundlerextension
dejavu
events
execute
kernel
kernelspec
migrate
nbclassic
nbconvert
nbextension
notebook
run
server
serverextension
troubleshoot
trust
上面查询出的有版本号的packages可以作为有效的subcommand
jupyter notebook
jupyter nbconvert
jupyter
命令帮助:
例如jupyter nbconvert -h
:
(d:\condaPythonEnvs\pt2.0) PS D:\repos\CCSER\d2l-zh> jupyter nbconvert -h
This application is used to convert notebook files (*.ipynb)
to various other formats.
WARNING: THE COMMANDLINE INTERFACE MAY CHANGE IN FUTURE RELEASES.
Options
=======
The options below are convenience aliases to configurable class-options,
as listed in the "Equivalent to" description-line of the aliases.
To see all configurable class-options for some <cmd>, use:
<cmd> --help-all
...
--to=<Unicode>
The export format to be used, either one of the built-in formats
['asciidoc', 'custom', 'html', 'latex', 'markdown', 'notebook', 'pdf', 'python', 'qtpdf', 'qtpng', 'rst', 'script', 'slides', 'webpdf']
or a dotted object name that represents the import path for an
``Exporter`` class
Default: ''
Equivalent to: [--NbConvertApp.export_format]
...
--output=<Unicode>
overwrite base name use for output files.
can only be used when converting one notebook at a time.
Default: ''
Equivalent to: [--NbConvertApp.output_base]
--output-dir=<Unicode>
Directory to write output(s) to. Defaults
to output to the directory of each notebook. To recover
previous default behaviour (outputting to the current
working directory) use . as the flag value.
Default: ''
Equivalent to: [--FilesWriter.build_directory]
Sharing and Publishing Jupyter Notebooks: Exporting the Jupyter Notebook (reproducible-science-curriculum.github.io)
命令行方式特别擅长于配合脚本语言,批量转换和脚本化
(d:\condaPythonEnvs\pt2.0) PS D:\repos\CCSER\d2l-zh\chapter_preliminaries> jupyter nbconvert .\linear-algebra.ipynb --to markdown --output demo.md
[NbConvertApp] Converting notebook .\linear-algebra.ipynb to markdown
[NbConvertApp] Writing 16668 bytes to demo.md
Install Anaconda or Miniconda if you don’t have it already
Open a terminal (Anaconda Prompt) and type conda install jupyter notebook
and press enter
Wait for the installation to finish and then launch Jupyter Notebook by typing jupyter notebook in the terminal.
激活需要安装jupyter notebook的环境后开始安装
(d:\condaPythonEnvs\ser_keras2_2) PS D:\repos\CCSER\Speech-Emotion-Recognition> conda install jupyter notebook
Collecting package metadata (current_repodata.json): done
....
执行jupyter notebook
Verifying transaction: done
Executing transaction: done
(d:\condaPythonEnvs\ser_keras2_2) PS D:\repos\CCSER\Speech-Emotion-Recognition> jupyter notebook
[I 19:10:43.905 NotebookApp] The port 8888 is already in use, trying another port.
[I 19:10:43.907 NotebookApp] Serving notebooks from local directory: D:\repos\CCSER\Speech-Emotion-Recognition
[I 19:10:43.907 NotebookApp] Jupyter Notebook 6.4.3 is running at:
[I 19:10:43.907 NotebookApp] http://localhost:8889/?token=285f567f2a4562439eccb00e4407e863c8ead92de4eecb6d
[I 19:10:43.907 NotebookApp] or http://127.0.0.1:8889/?token=285f567f2a4562439eccb00e4407e863c8ead92de4eecb6d
[I 19:10:43.907 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 19:10:43.915 NotebookApp]
To access the notebook, open this file in a browser:
file:///C:/Users/cxxu/AppData/Roaming/jupyter/runtime/nbserver-19244-open.html
Or copy and paste one of these URLs:
http://localhost:8889/?token=285f567f2a4562439eccb00e4407e863c8ead92de4eecb6d
or http://127.0.0.1:8889/?token=285f567f2a4562439eccb00e4407e863c8ead92de4eecb6d
d:\condaPythonEnvs\ser_keras2_2\lib\json\encoder.py:257: UserWarning: date_default is deprecated since jupyter_client 7.0.0. Use jupyter_client.jsonutil.json_default.
return _iterencode(o, 0)
conda install -n ipykernel --update-deps --force-reinstall
setting id:jupyter.defaultCellMarker
利用标记(安装jupyter插件后)
#%%
(标记可以后期修改)
并执行run(鼠标点击/快捷键出发),可以打开右侧交互窗口
例如:
Jupyter:
系列
一下是本人自用方案:
run above:
run current cell:
insert cell below position:
ctrl+k ctrl+j
或者
ctrl+k ctrl+p
insert cell below:
problems:Focus on problems view
new create a jupyter file:
您可以直接在工作目录下新建文件:以ipynb为后缀的文件
也使用 ctrl+shift+p:输入指令new jupyter
创建
anaconda - conda install downgrade python version - Stack Overflow
激活需要降级的conda环境
执行安装特定python版本的指令
conda install python=3.xx.xx
Note: