👀

【備忘録】忘れがちなvenvでのPython仮想環境の作り方 + jupyterのカーネル追加

に公開

調べたらすぐに出てくることですが、自分用のメモとミニマムな情報でよいという方のために。
Windows onlyで書いてます

手順

環境の作成

python -m venv venv

※ 仮想環境名をvenvとしています

Activate

.\venv\Scripts\activate

仮想環境内で

ipykernelのインストール

pip install ipykernel

jupyterにカーネル追加

ipython kernel install --user --name=venv

仮想環境から抜けたいとき

Deactivate

deactivate

参考

https://qiita.com/fiftystorm36/items/b2fd47cf32c7694adc2e
https://qiita.com/Gonsuna/items/80a5d36673ba2b6ef7f0

Discussion