Python3.10.5与jupyterlab 安装

段干弘毅
2023-12-01

一、python3.10.5安装:

  1. 下载地址:官网
  2. 安装过程:
  • 去掉【Install laucher for all users】;勾选【Add Python 3.10 to Path】;然后点击【Customize installation】
  • 去掉【py launcher】;点击【Next】
  • 勾选【Precompile standard library】;填入【Customize install location】为:D:\myApply\python3.10.4;然后点击【Install】
  • 备份安装的Python目录(D:\myApply\python3.10.4)
  • 卸载刚安装的Python
  • 将备份的Python目录恢复到原来的安装目录(D:\myApply\python3.10.4)
  • 将【原来的安装目录】(D:\myApply\python3.10.4)加到【Path】环境变量中;
  • 将D:\myApply\python3.10.4\Scripts\ 加到【Path】环境变量中;
  • 测试:新开一个cmd窗口,运行:python --version
  1. 安装python库

REM 格式检查
pip install wheel autopep8 flake8 pylint yapf

REM office套装
pip install python-office

REM 视频图像处理
pip install opencv-python matplotlib pillow

REM 网络处理
pip install Flask

REM PyTorch安装
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

REM 中文识别
pip3 install pytesseract

REM 数据库
pip3 install SQLAlchemy

REM pydocstyle
REM rope
REM snowballstemmer

二、安装jupyterlab

  1. pip 安装的插件
REM jupyterlab安装
pip install jupyterlab
pip install jupyterlab-language-pack-zh-CN
pip install ipympl npm nodejs
pip install jupyter-lsp python-lsp-server python-language-server
pip install https://files.pythonhosted.org/packages/42/ba/a9d64c7bcbc7e3e8e5f93a52721b377e994c22d16196e2b0f1236774353a/pathspec-0.9.0-py2.py3-none-any.whl
pip install black isort
pip install jupyterlab_markup jupyterlab_latex jupyterlab-dash
pip install jupyterlab-fasta jupyterlab-geojson jupyterlab-katex
pip install jupyterlab-mathjax3 jupyterlab-vega2 jupyterlab-vega3
pip install jupyterlab_code_formatter jupyter_bokeh nbresuse
  1. jupyter labextension按装的插件
jupyter labextension install @jupyterlab/toc
jupyter labextension install @jupyterlab/debugger-extension

REM 在jupyter lab中进行debug
jupyter labextension install @jupyterlab/debugger

REM 安装lsp插件
pip install jupyter-lsp
pip install python-lsp-server[all]
pip install python-language-server[all]
jupyter labextension install @krassowski/jupyterlab-lsp

REM jupyterlab-drawio是一个让我们可以在jupyter lab界面内基于drawio绘制流程图、思维导图等示意图的插件
jupyter labextension install jupyterlab-drawio

REM jupyterlab-spreadsheet帮助我们在jupyter lab中查看表格类文件,特别是其支持查看多工作表的excel表格文件
jupyter labextension install jupyterlab-spreadsheet

REM jupyterlab-system-monitor通过在jupyter lab界面中添加资源监视器部件,能帮助我们在工作过程中方便的看到CPU、内存的实时占用情况:
pip install nbresuse
jupyter labextension install jupyterlab-topbar-extension jupyterlab-system-monitor

REM jupyterlab-plotly是一款帮助plotly图像在jupyter lab中正常渲染的插件
jupyter labextension install plotlywidget

  1. 列出已安装的扩展插件

jupyter labextension list

JupyterLab v3.4.3
python3105\share\jupyter\labextensions
        jupyter-matplotlib v0.11.1 enabled ok
        jupyterlab-plotly v5.9.0 enabled ok
        jupyterlab_pygments v0.2.2 enabled ok (python, jupyterlab_pygments)
        @agoose77/jupyterlab-markup v2.0.0 enabled ok (python, jupyterlab_markup)
        @bokeh/jupyter_bokeh v3.0.4 enabled ok (python, jupyter_bokeh)
        @jupyter-widgets/jupyterlab-manager v3.1.1 enabled ok (python, jupyterlab_widgets)
        @jupyterlab/fasta-extension v3.2.0 enabled ok (python, jupyterlab-fasta)
        @jupyterlab/geojson-extension v3.2.0 enabled ok (python, jupyterlab-geojson)
        @jupyterlab/katex-extension v3.3.0 enabled ok (python, jupyterlab-katex)
        @jupyterlab/latex v3.1.0 enabled ok (python, jupyterlab-latex)
        @jupyterlab/mathjax3-extension v4.3.0 enabled ok (python, jupyterlab-mathjax3)
        @jupyterlab/server-proxy v3.2.1 enabled ok
        @jupyterlab/vega2-extension v3.2.0 enabled ok (python, jupyterlab-vega2)
        @jupyterlab/vega3-extension v3.2.0 enabled ok (python, jupyterlab-vega3)
        @ryantam626/jupyterlab_code_formatter v1.4.11 enabled ok (python, jupyterlab-code-formatter)

Other labextensions (built into JupyterLab)
   app dir: python3105\share\jupyter\lab
        @jupyterlab/debugger v3.4.3 enabled ok
        @jupyterlab/toc v5.4.3 enabled ok
        @krassowski/jupyterlab-lsp v3.10.1 enabled ok
        jupyterlab-drawio v0.9.0 enabled ok
        jupyterlab-spreadsheet v0.4.1 enabled ok
        jupyterlab-system-monitor v0.7.0 enabled ok
        jupyterlab-topbar-extension v0.6.0 enabled ok
        plotlywidget v4.14.3 enabled ok


Disabled extensions:
    @jupyterlab/mathjax2-extension:plugin

问题:

  1. No such comm target registered: jupyter.widget.control
[IPKernelApp] ERROR | No such comm target registered: jupyter.widget.control
[IPKernelApp] WARNING | No such comm: d1202b8c-e956-44fa-8346-09dc95a6a094

原因: 1.1.1版本有问题
解决: pip install jupyterlab-widgets==1.0.2

 类似资料: