jupyter4.4安裝使用

一、chrome谷歌瀏覽器

1. 安裝

  • 1.1 下載地址:

下載地址: https://www.google.cn/intl/zh-CN_ALL/chrome/fallback/

2 插件markdown-viewer

  • 2.1 下載地址:

下載地址:https://github.com/simov/markdown-viewer/releases

  • 2.2 設置(打開mermaid渲染)
    • 【擴展程序】–>打開【開發者模式】
    • 【詳情】–>【擴展程序選項】–>【Settings】打開:mermaid,mathjax

二、python安裝(構建綠色版):

  1. 下載地址:https://mirrors.huaweicloud.com/python/3.13.3/

  2. 安裝到 \path\to\Python3133

  3. 拷貝\path\to\Python3133 到\path\to\Python3133_bak

  4. 卸載python3.13.3

  5. 拷貝\path\to\Python3133_bak 到\path\to\Python3133

  6. 添加環境變量:\path\to\Python3133\Scripts和\path\to\Python3133到PATH

  7. 在\path\to\Python3133添加兩個文件python3.13.3.bat 和 python3133.bat,內容如下:

    @echo off
    echo 原始命令:%~f0 %*
    echo 運行命令:%~d0%~p0python.exe %*
    %~d0%~p0python.exe %*
    
  8. 在\path\to\Python3133添加兩個文件python3.13.3.sh 和 python3133.sh,內容如下:

    base_dir=$(cd $(dirname $0);pwd)
    echo 原始命令:$0 $*
    echo 運行命令:${base_dir}/python.exe $*
    ${base_dir}/python.exe $*
    
  9. 在\path\to\Python3133\Scripts添加兩個文件pip3.13.3.bat 和 pip3133.bat,內容如下:

    @echo off
    echo 原始命令:%~f0 %*
    echo 運行命令:%~d0%~p0pip.exe %*
    %~d0%~p0pip.exe %*
    
  10. 在\path\to\Python3133\Scripts添加兩個文件pip3.13.3.sh 和 pip3133.sh,內容如下:

    base_dir=$(cd $(dirname $0);pwd)
    echo 原始命令:$0 $*
    echo 運行命令:${base_dir}/pip.exe $*
    ${base_dir}/pip.exe $*
    
  11. 測試:

    • 在cmd窗口中
      python3.13.3 --version
      pip3133 --version
      
    • 在gitbash窗口中
      python3.13.3.sh --version
      pip3133.sh --version
      

三、安裝jupyter

  1. 創建虛擬環境

    • cmd窗口
      mkdir .\my_jupyter
      cd .\my_jupyterpython3.13.3 -m venv jupyter_venv
      .\jupyter_venv\Scripts\activate
      pip install requests
      deactivate
      
    • Git Bash窗口
      cd path/to/your/project
      mkdir ./my_jupyter
      python3.13.3.sh -m venv jupyter_venvsource ./jupyter_venv/Scripts/activate
      pip install requests
      deactivate
      
  2. 安裝jupyterlab

    • 相關網址:
      • github
      • 官網
      • https://github.com/jupyter/jupyter-packaging
    • 安裝:
      pip install jupyterlab
      
  3. 漢化:

    • 相關網址:
      • https://github.com/jupyterlab/language-packs/releases
    • 安裝:
      pip install jupyterlab-language-pack-zh-CN
      
    • 設置:
      【Settings】–>【Language】–>【Chinese (simplified, China)】
  4. 插件:

    • 相關網址:

      • https://github.com/jupyter-lsp/jupyterlab-lsp
    • 安裝:

      pip install jupyterlab-lsp
      pip install python-lsp-server
      pip install "python-lsp-server[all]"
      pip install jupyterlab-spreadsheet-editor
      pip install jupyterlab-spreadsheet
      pip install jupyterlab_iframe
      pip install jupyterlab-code-formatter
      pip install jupyterlab_execute_time
      pip install bash_kernel
      pip install jupyterlab_myst
      pip install jupyterlab-latex
      

四、插件:

  1. 可以直接安裝的插件:
    pip install json-lsp
    pip install yaml-lsp
    pip install jupyterlab_sql_editor[all]
    pip install sshkernel
    pip install jupyterlite-xeuspip install metakernel==0.25.*
    pip install python-language-server[all]
    
  2. 兩個相對成熟的官網插件:
    • https://jupyterlab-contrib.github.io/extensions.html
    • https://github.com/ml-tooling/best-of-jupyter#jupyterlab-extensions
  3. 插件管理
注意:如果沒有出現插件選項卡,可以通過 setting–>Advanced Settings Editor–Extension Manager :在User Overrides 添加語句{“enabled”: true},最后保存,就可以出現插件選項
當然,你也可以使用命令行方式進行插件的查看、安裝、更新和刪除查看已安裝插件:jupyter labextension list
更新已安裝插件:jupyter labextension update --all
安裝插件toc:jupyter labextension install @jupyterlab/toc
刪除插件toc:jupyter labextension uninstall @jupyterlab/toc
  1. 常用插件
# 大部分不適用于 jupyter-lab 4.4,止步于jupyter-lab  3.4
REM 安裝matplotlib 插件
pip install ipympl
pip install npm
pip install nodejs
jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlibREM 安裝lsp插件
pip install jupyter-lsp
pip install python-lsp-server[all]
pip install python-language-server[all]
jupyter labextension install @krassowski/jupyterlab-lspREM 安裝code formatter 插件
pip install jupyterlab_code_formatter
jupyter labextension install @ryantam626/jupyterlab_code_formatter
pip install black isortREM jupyterlab-toc幫助我們在notebook界面利用markdown來創建目錄,輔助我們更好地整合梳理數據分析工作流
jupyter labextension install @jupyterlab/tocjupyter labextension install @jupyterlab/debugger-extensionREM 在jupyter lab中進行debug
jupyter labextension install @jupyterlab/debuggerREM jupyterlab-drawio是一個讓我們可以在jupyter lab界面內基于drawio繪制流程圖、思維導圖等示意圖的插件
jupyter labextension install jupyterlab-drawioREM jupyter-matplotlib幫助我們在notebook界面配合matplotlib實現交互式的作圖,只需要在繪圖之前執行魔法命令%matplotlib widget,之后繪制的所有matplotlib圖表即可自動轉換為交互式的
pip install ipympl
jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlibREM jupyterlab-execute-time插件幫助我們在jupyter lab中記錄每個單元cell的執行開始以及運行耗時
jupyter labextension install jupyterlab-execute-timeREM jupyterlab-plotly是一款幫助plotly圖像在jupyter lab中正常渲染的插件
jupyter labextension install @jupyter-widgets/jupyterlab-manager plotlywidgetREM jupyterlab-spreadsheet幫助我們在jupyter lab中查看表格類文件,特別是其支持查看多工作表的excel表格文件
jupyter labextension install jupyterlab-spreadsheetREM jupyterlab-system-monitor通過在jupyter lab界面中添加資源監視器部件,能幫助我們在工作過程中方便的看到CPU、內存的實時占用情況:
pip install nbresuse
jupyter labextension install jupyterlab-topbar-extension jupyterlab-system-monitorREM 通過使用在JupyterLab中添加對markdown的其他渲染支持 markdown-it,以及以下內容 插件
pip install jupyterlab_markup
jupyter labextension install @agoose77/jupyterlab-markuppip install jupyterlab_latex
jupyter labextension install @mflevine/jupyterlab_html
pip install jupyterlab-dash
pip install jupyterlab-githubREM 該插件可以在Lab中展示plotly可視化效果。
pip install jupyterlab-fasta
pip install jupyterlab-geojson
pip install jupyterlab-katex
pip install jupyterlab-mathjax3
pip install jupyterlab-vega2
pip install jupyterlab-vega3
pip install jupyterlab-plotlyREM 該插件可以在Lab中展示bokeh可視化效果。
pip install jupyter_bokehREM 該插件可以在Lab中連接數據庫,并進行sql查詢和修改操作。會報錯:The extension "jupyterlab-sql" is outdated
REM pip install jupyterlab_sql
  1. 代碼自動提示完成
pip install jupyter-lsp
pip install python-lsp-server[all]
jupyter labextension install @krassowski/jupyterlab-lsp

五、安裝java內核:

  1. 安裝jdk(openjdk):
    • 官網:
      • https://openjdk.org/
      • https://jdk.java.net/archive/
      • https://adoptium.net/zh-CN/temurin/archive/?version=11
    • 下載版本:(11 GA (build 11+28) Windows 64-bit)
      • 地址:https://download.java.net/java/ga/jdk11/openjdk-11_windows-x64_bin.zip
    • 安裝:
      將openjdk-11_windows-x64_bin.zip解壓到指定目錄:/path/to
  2. 安裝ijava:
    • 官網:https://github.com/SpencerPark/IJava/releases
    • 解壓:ijava-1.3.0.zip到\my_jupyter\packages目錄下
    • 安裝內核:
     cd /path/to/my_jupyter/packages/ijava-1.3.0python install.py --prefix=/path/to/my_jupyter/jupyter_venvjupyter kernelspec list
    
  3. 修改配置文件:
    • 文件:/path/to/my_jupyter\jupyter_venv\share\jupyter\kernels\java\kernel.json
    • 修改:將java指定其絕對路徑(將\path\to換成自己的真實路徑)
    • 內容示例如下:
    {"argv": ["\\path\\to\\jdk-11\\bin\\java","-jar","\\path\\to\\my_jupyter\\jupyter_venv\\share\\jupyter\\kernels\\java/ijava-1.3.0.jar","{connection_file}"],"display_name": "Java","env": {},"interrupt_mode": "message","language": "java"
    }
    

六、配置

1. 生成配置文件

jupyter lab --generate-config

存放路徑:C:\Users%USERNAME%.jupyter\jupyter_lab_config.py

2. 生成并保存密碼:

python -c "from jupyter_server.auth import passwd;print(passwd())"

3. 修改配置文件:

然后修改生成的配置文件 C:\Users%USERNAME%.jupyter\jupyter_lab_config.py 就可以了

c.ServerApp.allow_remote_access = False
c.ServerApp.open_browser = True
c.ServerApp.browser = 'C:/Program Files/Google/Chrome/Application/chrome.exe --app=%s'
c.ServerApp.root_dir = "/path/to/my_jupyter/jupyter_data"c.ServerApp.ip = '0.0.0.0'
c.ServerApp.port = 8888c.PasswordIdentityProvider.hashed_password = "argon2:$arg********A"
c.PasswordIdentityProvider.password_required = True

4. 將配置文件移動到自己的my_jupyter目錄下

七、啟動

1. 命令行啟動

jupyter-lab --config=../jupyter_lab_config.py
\path\to\my_jupyter\jupyter_venv\Scripts\jupyter-lab.exe --config=\path\to\my_jupyter\jupyter_lab_config.py

2. 命令行指定root-dir

jupyter-lab --config=../jupyter_lab_config.py --notebook-dir=\path\to\my_jupyter\jupyter_data
\path\to\my_jupyter\jupyter_venv\Scripts\jupyter-lab.exe --config=\path\to\my_jupyter\jupyter_lab_config.py  --notebook-dir=\path\to\my_jupyter\jupyter_data

2. 桌面快捷方式

  • 2.1 創建jupyter-lab.exe快捷方式
  • 2.2 修改啟動命令,添加參數: --config=\path\to\my_jupyter\jupyter_lab_config.py
  • 2.3 下載一個jupyter-lab圖片,使用GIMP2導出為ico
  • 2.4 修改快捷方式的圖標

3. 直接下載桌面應用

  • https://github.com/jupyterlab/jupyterlab-desktop

八、conda包轉wheel包

pypi中無法安裝的包(需要本地編譯,例如y-py需要Rust語言環境),而conda中有編譯好的包,
但是不是wheel,需要轉換。所以本章節就處理這種包。

  1. 下載:

    • 官網:
    • 跳過注冊:【Skip registration】
  2. 設置國內源

    # 清華源
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
    #設置搜索時顯示通道地址
    conda config --set show_channel_urls yes# 中科大鏡像源
    conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
    conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
    conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
    conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
    conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
    conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/#設置搜索時顯示通道地址
    conda config --set show_channel_urls yes
    
  3. 創建虛擬環境:

    cd /path/to/
    conda create --name conda_py312_venv python=3.12
    conda create --name conda_py313_venv python=3.13conda activate conda_py313_venv
    conda env listconda install y-pyconda deactivate
    
  4. 打包環境:

    conda install -c conda-forge conda-pack
    conda pack -n conda_py313_venv -o conda_py313_venv.tar.gz
    
  5. 下載conda包:

    • 官網:https://anaconda.org/anaconda/y-py/files
  6. 將conda包轉為wheel包(以y-py為例)

    • 下載對應的包:
      • 官網:https://anaconda.org/anaconda/y-py/files
      • 相應版本:win-64/y-py-0.6.2-py313h636fa0f_2.tar.bz2
      • 下載:地址
    • 解壓(Git Bash):
      tar -xvjf y-py-0.6.2-py313h636fa0f_2.tar.bz2
      cd ./Lib/site-packages
      
    • 創建pyproject.toml文件
      [build-system]
      requires = ["setuptools", "wheel"]
      build-backend = "setuptools.build_meta"[project]
      name = "y-py"
      version = "0.6.2"[tool.setuptools.packages.find]
      exclude = ["build"]
      [tool.setuptools.package-data]
      "*" = ["*.pyd"]
      "y_py" = ["*.pyd"]
      
    • 打包為wheel
      pip install build wheel
      python -m build
      python -m build --wheel
      pip install dist\y_py-0.6.2-py3-none-any.whl
      
    • 安裝測試:
      pip install dist\y_py-0.6.2-py3-none-any.whl
      
    • 驗證:
      import y_py as Y
      d1 = Y.YDoc()
      print(d1)
      
  7. 其他包(下面兩個包使用的是jupyter-lab3):

    conda install conda-forge::jupyterlab-markup
    conda install conda-forge::jupyterlab-drawio
    

? 著作權歸作者所有

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/901273.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/901273.shtml
英文地址,請注明出處:http://en.pswp.cn/news/901273.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

STM32 HAL庫RTC實時時鐘超細詳解

一、引言 在嵌入式系統的應用中,實時時鐘(RTC)是一個非常重要的功能模塊。它能夠獨立于主系統提供精確的時間和日期信息,即使在系統斷電的情況下,也可以依靠備用電池繼續運行。STM32F407 是一款性能強大的微控制器&am…

vdso概念及原理,vdso_fault缺頁異常,vdso符號的獲取

一、背景 vdso的全稱是Virtual Dynamic Shared Object,它是一個特殊的共享庫,是在編譯內核時生成,并在內核鏡像里某一段地址段作為該共享庫的內容。vdso的前身是vsyscall,為了兼容一些舊的程序,x86上還是默認加載了vs…

Linux中的文件傳輸(附加詳細實驗案例)

一、實驗環境的設置 ①該實驗需要兩臺主機,虛擬機名稱為 L2 和 L3 ,在終端分別更改主機名為 node1 和 node2,在實驗過程能夠更好分辨。 然后再重新打開終端,主機名便都更改了相應的名稱。 ②用 ip a 的命令分別查看兩個主機的 …

【從0到1學Elasticsearch】Elasticsearch從入門到精通(上)

黑馬商城作為一個電商項目,商品的搜索肯定是訪問頻率最高的頁面之一。目前搜索功能是基于數據庫的模糊搜索來實現的,存在很多問題。 首先,查詢效率較低。 由于數據庫模糊查詢不走索引,在數據量較大的時候,查詢性能很差…

圖論基礎理論

在我看來,想要掌握圖的基礎應用,僅需要三步走。 什么是圖(基本概念)、圖的構造(打地基)、圖的遍歷方式(應用的基礎) 只要能OK的掌握這三步、就算圖論入門了!&#xff0…

詳細解讀react框架中的hooks

React Hooks 是 React 16.8 引入的一項革命性特性,它允許你在函數組件中使用狀態(state)和其他 React 特性,而無需編寫 class 組件。下面將詳細解讀 React Hooks 的核心概念、常用 Hooks 及其工作原理。 一、Hooks 的核心概念 1. 什么是 Hooks Hooks …

主機IP動態變化時如何通過固定host.docker.internal訪問本機服務

場景需求——主機IP動態變化時,通過固定的 http://host.docker.internal:11555 訪問本機服務,核心問題在于 host.docker.internal 的解析邏輯與動態IP的適配。以下是分步解決方案: 一、核心原理:host.docker.internal 的本質與局…

插值算法 - 最近鄰插值實現

目錄 1. 導入必要的庫 2. nearest_neighbor_interpolation 3. 測試代碼 數學原理 完整代碼 本文實現了基于最近鄰插值算法的圖像縮放功能。 它使用 Python 編寫,主要依賴于NumPy和PIL(Python Imaging Library)庫。 NumPy用于高效的數值計算,而PIL僅用于圖像的加載和…

windows中搭建Ubuntu子系統

windows中搭建虛擬環境 1.配置2.windows中搭建Ubuntu子系統2.1windows配置2.1.1 確認啟用私有化2.1.2 將wsl2設置為默認版本2.1.3 確認開啟相關配置2.1.4重啟windows以加載更改配置 2.2 搭建Ubuntu子系統2.2.1 下載Ubuntu2.2.2 遷移位置 3.Ubuntu子系統搭建docker環境3.1安裝do…

MySQL事務機制

目錄 原子性 持久性 隔離性 隔離級別(并發事務之間的關系) 讀未提交 讀已提交 可重復讀 串行化(最嚴格的隔離級別) 一致性 問題 不可重復讀性(已經提交的數據) 什么是臟讀問題(未提交的數據)? 幻讀 保存點 自動提交機制--autocommit 會話隔離級別與全局隔離級…

Cadence學習筆記之---直插元件的封裝制作

目錄 01 | 引 言 02 | 環境描述 03 | 操作步驟 04 | 結 語 01 | 引 言 在之前發布的Cadence小記中,已經講述了怎樣制作熱風焊盤,貼片(SMD)焊盤、通孔、過孔,以及貼片元件的封裝。 本篇關于Cadence的小記主要講如何制作直插元件的封裝。 …

【第四十周】文獻閱讀:用于檢索-增強大語言模型的查詢與重寫

目錄 摘要Abstract用于檢索-增強大語言模型的查詢與重寫研究背景方法論基于凍結LLM的重寫方案基于可訓練重寫器的方案重寫器預熱訓練(Rewriter Warm-up)強化學習(Reinforcement Learning) 創新性實驗結果局限性總結 摘要 這篇論文…

java學習總結(if switch for)

一.基本結構 1.單分支if int num 10; if (num > 5) {System.out.println("num 大于 5"); } 2.雙分支if-else int score 60; if (score > 60) {System.out.println("及格"); } else {System.out.println("不及格"); } 3.多分支 int…

yum的基本操作和vim指令

在我們的手機端或者Windows上下載軟件,可以在相應的應用商店或者官網進行下載,這樣對于用戶來說十分的方便和便捷。而在Linux上,也有類似的安裝方式,我們來一一了解一下。 Linux安裝軟件的3種方法 源代碼安裝 在Linux下安裝軟件…

C++ CUDA開發入門

CUDA開發筆記 文章目錄 CUDA開發筆記[toc]1 概述2 環境3 命令行編譯4 CMAKE引入CUDA5 vscode開發CUDA6 Qt中使用CUDA-CMake7 QMake配置CUDA8 核函數9 核函數調用9.1 核函數調用語法9.2 執行配置參數詳解9.3 關鍵調用步驟9.4 重要注意事項9.5 調用示例分析9.6 最佳實踐建議 10 線…

llm開發框架新秀

原文鏈接:https://i68.ltd/notes/posts/20250404-llm-framework3/ google開源ADK-Agent Development Kit 開源的、代碼優先的 Python 工具包,用于構建、評估和部署具有靈活性和控制力的復雜智能體項目倉庫:https://github.com/google/adk-python 2.6k項目文檔:Age…

VM——相機拍照失敗

1、問題:相機頻閃觸發,在MVS中正常出圖,在VM中出現拍照失敗 2、解決: 1、首先排查網絡設置(巨幀是否設置) 2、電腦的所有防火墻是否關閉 3、在MVS中恢復相機的設置參數為默認參數,刪除VM中的全…

【時頻譜分析】小波分析

算法配置頁面,也可以一鍵導出結果數據 報表自定義繪制 獲取和下載【PHM學習軟件PHM源碼】的方式 獲取方式:Docshttps://jcn362s9p4t8.feishu.cn/wiki/A0NXwPxY3ie1cGkOy08cru6vnvc

怎么免費下載GLTF/GLB格式模型文件,還可以在線編輯修改

? 現在非常流行glb格式模型,和gltf格式文件,可是之類模型網站非常非常少 1,咱們先直接打開http://glbxz.com 官方glb下載網站 glbxz.com 2 可以搜索,自己想要的模型關鍵詞 3,到自己想下載素材頁面 4,…

【6】深入學習http模塊(萬字)-Nodejs開發入門

深入學習http模塊 前言http一個Web服務器項目創建代碼運行代碼解析 Server屬性:keepAlive屬性:keepAliveTimeout屬性:maxHeaderSize屬性:requestTimeout屬性:maxRequestsPerSocket方法:close()方法&#xf…