从JupyterLab创建Python文件
jupyterlab-python-file的Python项目详细描述
jupyterlab python文件
从JupyterLab创建Python文件
先决条件
- JupyterLab 1.0+
安装
对于JupyterLab 3.x,可以使用pip
安装扩展:
pip install jupyterlab-python-file
或使用conda
:
对于JupyterLab 1.x和2.x:
jupyter labextension install jupyterlab-python-file
发展
注意:您将需要NodeJS来构建扩展包。在
jlpm
命令是JupyterLab的pinned版本
yarn与JupyterLab一起安装。你可以用
yarn
或npm
代替下面的jlpm
。在
# Clone the repo to your local environment# Change directory to the jupyterlab-python-file directory# create a new environment conda create -n jupyterlab-python-file -c conda-forge python nodejs -y conda activate jupyterlab-python-file # install the JupyterLab pre-release python -m pip install --pre jupyterlab # Install package in development mode pip install -e . # Link your development version of the extension with JupyterLab jupyter labextension develop . --overwrite # Rebuild extension Typescript source after making changes jlpm run build
您可以监视源目录,并在不同的终端上同时运行JupyterLab,以监视扩展源代码中的更改并自动重建扩展。在
# Watch the source directory in one terminal, automatically rebuilding when needed jlpm run watch # Run JupyterLab in another terminal jupyter lab
运行watch命令后,每个保存的更改都将立即在本地生成,并在运行的JupyterLab中可用。刷新JupyterLab以在浏览器中加载更改(可能需要等待几秒钟才能重建扩展)。在
- 项目
标签: