Jupyterlabの導入
$ conda install jupyterlab
$ conda install pandas numpy scikit-learn seaborn matplotlib
$ conda install jupyterlab
$ conda install pandas numpy scikit-learn seaborn matplotlib
I daily use the jupyter lab for data analysis workflow. Recently I updated the jupyter lab and I found that the jupyterlab extension manager can be available. Since then I frequently check the jupyterlab extension to make my jupyter environment more useful and productive.
Jupyterlab Extension Manager -- T.Y. Blog
There are some stuffs I always use in the notebook such as description markdown cells and import-modules cells for notebooks. Today I found an extension for jupyterlab that seems useful for setting up templates.
Jupyterlab_template
Support for jupyter notebook templates in jupyterlab
Installation guide is available in github README.md. Since I use conda for package management, I install jupyterlab_templates using conda install ,
(base) tk$ conda install -c conda-forge jupyterlab_templates
Retrieving notices: ...working... done
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /Path/to/miniconda3
added / updated specs:
- jupyterlab_templates
The following packages will be downloaded:
package | build
---------------------------|-----------------
jupyterlab_templates-0.3.2 | pyh1d7be83_0 72 KB conda-forge
------------------------------------------------------------
Total: 72 KB
The following NEW packages will be INSTALLED:
jupyterlab_templa~ conda-forge/noarch::jupyterlab_templates-0.3.2-pyh1d7be83_0
Proceed ([y]/n)? y
(base) tk$ jupyter lab --generate-config
Writing default config to: /Path/to/home/.jupyter/jupyter_lab_config.py
c.JupyterLabTemplates.template_dirs = ['/Path/to/template/directory']
c.JupyterLabTemplates.include_default = True
c.JupyterLabTemplates.include_core_paths = True
^G Get Help ^O WriteOut ^R Read File ^Y Prev Pg ^K Cut Text ^C Cur Pos
^X Exit ^J Justify ^W Where is ^V Next Pg ^U UnCut Text ^T To Spell
Recently I updated the jupyter lab on my personal computer after a long time since the last execution.
(base) tk$ conda update conda
(base) tk$ pip install jupyter-kite
Collecting jupyterlab-kite
Downloading jupyterlab-kite-2.0.2.tar.gz (266 kB)
base) tk$ conda install -c conda-forge nodejs
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /path/to/my/home/miniconda3
added / updated specs:
- nodejs
The following packages will be downloaded:
package | build
---------------------------|-----------------
libuv-1.44.2 | hac89ed1_0 441 KB conda-forge
nodejs-18.13.0 | hd0c9b3c_0 10.3 MB conda-forge
------------------------------------------------------------
Total: 10.8 MB
The following NEW packages will be INSTALLED:
libuv conda-forge/osx-64::libuv-1.44.2-hac89ed1_0
nodejs conda-forge/osx-64::nodejs-18.13.0-hd0c9b3c_0
Kite is saying farewellFrom 2014 to 2021, Kite was a startup using AI to help developers write code. We have stopped working on Kite, and are no longer supporting the Kite software.
Thank you to everyone who used our product, and thank you to our team members and investors who made this journey possible.
(base) tk$ pip uninstall jupyterlab-kite
Found existing installation: jupyterlab-kite 2.0.2
Uninstalling jupyterlab-kite-2.0.2:
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'. To initialize your shell, run $ conda init色々調べていくと、condaで作成した仮想環境をJupyter Notebookで使えるようにする方法があったので設定した。Currently supported shells are: - bash - fish - tcsh - xonsh - zsh - powershell See 'conda init --help' for more information and options. IMPORTANT: You may need to close and restart your shell after running 'conda init'.
conda create -n newenv python=3.7 # この環境に入る conda activate newenv # jupyterをインストールする pip install jupyter # jupyter_environment_kernelsをインストールする pip install environment_kernels[2] Jupyterの設定ファイルを生成する。
jupyter notebook --generate-config """ この作業により、ホームディレクトリの下の.jupyterの下に jupyter_notebook_config.pyというファイルができる。 この作業は一回やれば良い。2回目、3回目の環境の設定の時には必要ない """[3] 設定ファイルに、自動でconda環境を読み込む設定を追記する。
c.NotebookApp.kernel_spec_manager_class = 'environment_kernels.EnvironmentKernelSpecManager' c.EnvironmentKernelSpecManager.env_dirs=['/Users/username/anaconda/envs/']これで、Jupyterを再起動すれば、カーネルとしてnewenvを選択することができるようになる。カーネルは、Kernel > Change kernelから選択できる。