Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
48
Help us understand the problem. What is going on with this article?

More than 1 year has passed since last update.

@Gattaca

jupyter notebookでvenvを使う

割と最近仮想環境の重要性に気づいて、venvを使うようになったんですが、jupyter notebookを起動してみたところ、venvが適用されてない!
適用方法を調べてみたら意外と簡単だったので、メモしておきます。
こちらの記事を参考にしました。

Jupyter notebook on venv!

まず仮想環境を作って、activateします。

$ python -m venv projectname
$ source projectname/bin/activate

次に仮想環境上でipykernelをインストールします。

(projectname)$ pip install ipykernel

その後jupyterにカーネルを追加します。

(projectname)$ ipython kernel install --user --name=projectname

これでjupyter notebookを開くと、KernelタブのChenge kernelメニューにprojectnameが追加されていると思うので、それを選択すればOKです!

48
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
48
Help us understand the problem. What is going on with this article?