0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

vscodeでjupyter notebookファイル上でカーネル選択に仮想環境先を指定しようとしたがちょっと詰まった。

Posted at

仮想環境を構築したが、vscodeのjupyter notebookで構築した仮想環境を選択しようとして、少し詰まったので備忘録。

やったこと

  1. 選択先を指定する。
  2. 仮想環境にjpykernelをインストール

一つずつみましょう

1.選択先を指定する。

  1. コマンドパレットを開く
    Ctrl + Shift + P(Windows/Linux)または Cmd + Shift + P(macOS)を押します。
    コマンドパレットが表示されます。

  2. Pythonインタプリタを選択
    コマンドパレットに「Python: Select Interpreter」と入力し、選択します。

  3. 仮想環境のPythonを選択
    表示されたリストから、仮想環境のPythonインタプリタを選択します
    例: your_venv_name/bin/python(macOS/Linux)または your_venv_name\Scripts\python.exe(Windows)
    *この時のパスは開いているファイルの基準にした相対パス、もしくは絶対パスを入力。
    *ここでカーネル選択がされていなくても慌てず、カーネル選択→python環境を探せば出てくるはず

2.仮想環境にjpykernelをインストール

  • セルを実行しようとすると、仮想環境にjpykernelがないと怒られました。
#仮想環境を有効化
sorce your_venv_name/bin/python
#ライブラリをインストール
pip install ipykernel 

これでOK

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?