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?

More than 3 years have passed since last update.

Zshでanacondaの仮想環境を使う(不具合対応)

Last updated at Posted at 2020-01-01

概要

pyenvでインストールしたanacondaのJupyter Notebookをzshで使う(不具合対応)に続き,ZshでJupyter Notebookを使うための試行錯誤を備忘録としてまとめておく.

不具合状況

  • $ conda info -eで仮想環境が確認できるにも関わらず,$ conda activate <仮想環境名>でアクティベートできない

環境

Mac OS Mojave

方法

1. 仮想環境の実行をトライする

Terminal
$ conda activate <仮想環境名>

返ってきたエラーメッセージ

Terminal
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

2. イニシャライズ

Terminal
$ conda init <SHELL_NAME> ※今回は”zsh”

3.シェルの再起動

Terminal
$ exec $SHELL -l

余談. シェル再起動後の対応

シェルを再起動したら,プロンプトが(base) <ユーザー名>%となっていた.Pythonのベース環境内に入ってしまっているようだったので$ conda deactivateで仮想環境を終了.

参考にさせていただいたサイト

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?