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.

Catalinaにアップデートしたらanacondaが使えなくなった話

Posted at

概要

今更ながらmac high sierraからcatalinaにアップデートしたのですが、その際にanacondaが使えなくなったので解決方法をメモる

参考記事

修復について
https://qiita.com/akinko/items/1909c8d0145d9ba530b9

bashからzshへの移行
https://qiita.com/shionit/items/31bfffa5057e66e46450
zshでanacondaの記述が通るようにする
https://qiita.com/github-nakasho/items/aed4b29ae88f035970bb

方針

修正を①の記事を参考に試したのだが

conda init zsh

>> zsh: conda: command not found

となってしまい詰まったので再インストールする方法を取ることにした。
なさけない。

そのため

1.anacondaの公式サイトよりanacondaをインストール
2.bashからzshへ移行 ←お好み
3.zsh_profileにcondaを通す記述をする

でanacondaの再スタートを目指す。

1. anacondaのインストール

検索エンジンでanaconda macと調べれば公式サイトに飛べるのでgui操作で以下の記事に従ってダウンロードをすすめる。

2. bashからzshへの移行

catalinaではzshにメインのシェルが変更されるため、bashのときにあったpathが通らなくなる。
そんため、anacondaに限らず他の環境変数もなくなっているのでbashの設定を引き継ぐ必要がある。

※ただしbashのまま使い続ける場合はこの設定は必要ないので飛ばしてもらって構わない。

まずはuserのいちまでディレクトリを移動して以下をターミナルで実行する。

ターミナル
cat ~/.bash_profile >> ~/.zprofile
cat ~/.bashrc >> ~/.zshrc

これでbashの設定がzshに引き継がれる。

3.anacondaのPATHを通す

大体の人の場合、2で動くらしいのが自分の場合まだconda command not foundのままだったので③の記事の方法を試した。

ターミナル
echo "source ~/anaconda3/etc/profile.d/conda.sh" >> ~/.zshrc #pathを通す

source .zshrc #反映

これで

% conda --version
>> conda 4.8.3

となり、condaが使えるようになった。

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?