LoginSignup
26
38

More than 5 years have passed since last update.

Anacondaの仮想環境をJupyter notebookに反映させる方法

Last updated at Posted at 2019-01-09

環境:Windows10
前提:Anacondaをインストール済み

仮想環境の生成
$ conda create -n Name python=3.7 numpy jupyter
jupyterをインストールする必要がある

jupyter_environment_kernelsのインストール
$ pip install environment_kernels

Jupyterの設定ファイル生成
$ jupyter notebook --generate-config

Conda環境を読み込む設定を追記
C:/Users/userName/.jupyter/jupyter_notebook_config.pyに下記を追記する

jupyter_notebook_config.py
c.NotebookApp.kernel_spec_manager_class='environment_kernels.EnvironmentKernelSpecManager'
c.EnvironmentKernelSpecManager.env_dirs=['仮想環境が生成されているパス']

例)仮想環境が生成されているパス: C:/Users/userName/Anaconda3/envs/

ipynbファイルのメニュー→kernel→Change kernelで、作成した仮想環境が選択できるようになっている

参考
Condaで作ってる仮想環境の切り替えをJupyter上で簡単に行う方法
Anacondaで作った仮想環境をJupyter Notebookで使う方法

26
38
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
26
38