1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

jupyter notebookでcondaで作った仮想環境を使う

Last updated at Posted at 2022-01-15

やりたいこと

anacondaで仮想環境を作った。
これをjupyter notebook上で使いたい。

環境

  • windows 10
  • anacondaをインストール済み

やり方

前提

次のコマンドとかで仮想環境HOGEが既に作ってあるとする。

conda create -n HOGE

手順

  1. 環境HOGEに入る

    C:\Users\username> conda activate HOGE
    
  2. notebook, ipykernelをインストールする

    (HOGE) C:\Users\username> conda install notebook ipykernel
    
  3. jupyter notebookを実行

    (HOGE) C:\Users\username> jupyter notebook
    
  4. jupyter notebookのNewボタンからファイルを開き、必要なライブラリを使えるかimportとかしてみて確認する。できたら終わり。

    下の図では!conda listで入っているライブラリを表示して、確認している。
    また、import cv2を実行して正常にimportできるか確認している。

    スクリーンショット 2022-01-15 232817.png

2回目以降の入り方

terminalから環境HOGEに入って、jupyter notebook を実行するだけ

なぜ書いたか

普段はterminal上で環境を立てて使用しているが、他人にプログラムを教えることになり、jupyterを初めて触る必要が出たため。

余談

初めてqiita上で記事を書いた。久しぶりにマークダウンを書いて、書くのに結構時間がかかった。

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?