/opt/anaconda3/bin/conda init zsh をターミナルで実行しましたら下記が表示されました。
ユーザー名は別名に変えております。
no change /opt/anaconda3/condabin/conda
no change /opt/anaconda3/bin/conda
no change /opt/anaconda3/bin/conda-env
no change /opt/anaconda3/bin/activate
no change /opt/anaconda3/bin/deactivate
no change /opt/anaconda3/etc/profile.d/conda.sh
no change /opt/anaconda3/etc/fish/conf.d/conda.fish
no change /opt/anaconda3/shell/condabin/Conda.psm1
no change /opt/anaconda3/shell/condabin/conda-hook.ps1
no change /opt/anaconda3/lib/python3.7/site-packages/xontrib/conda.xsh
no change /opt/anaconda3/etc/profile.d/conda.csh
needs sudo /Users/ユーザー名/.zshrc
No action taken.
Operation failed.
ありがとうございます!
が、vim ~/.bash_profile を2回実行してしまったため、下記の表示がなされ、先に進まねくなってしまいました。。
E325: ATTENTION
Found a swap file by the name "~/.bash_profile.swp"
owned by: ユーザー名 dated: 金 3 17 15:03:40 2023
file name: ~ユーザー名 /.bash_profile
modified: YES
user name: ユーザー名 host name: ユーザー名 MacBook-Pro.local
process ID: xxxxx
While opening file "/Users/ユーザー名 /.bash_profile"
dated: 土 7 23 11:51:22 2022
(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /Users/ユーザー名 /.bash_profi
le"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/Users/ユーザー名 /.bash_profi
le.swp"
to avoid this message.
Swap file "~/.bash_profile.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
> zsh: command not found: conda
なので、anaconda用の設定が必要なのは「~/.zshrc」だけです
「~/.bash_profile」は関係無いので、それを修正する必要はありません
> E325: ATTENTION
Found a swap file by the name "~/.bash_profile.swp"
「vim ~/.bash_profile」で、修正したものを保存してないなら、「~/.bash_profile.swp」を削除してしまえばいいです
https://qiita.com/hiroyukiwk/items/01d7f7ada20adffe5c74
「~/.zshrc」の修正では、「E325: ATTENTION」とならないように気を付けてください
色々とありがとうございます。
「~/.bash_profile.swp」を削除してしまえばいいです
~/.zshrc」を削除
上記のご指示ですが、
コマンドで言うと、下記2つを入力し、実行したら良いという認識であっていますでしょうか。
vim ~/.bash_profile.swp
vim ~/.zshrc
> また1から新しくpython と anacondaをインストールすれば良いでしょうか。
その必要は無いはずです
which -a conda
を実行してcondaの絶対パスが表示されたら、「/Users/ユーザー名/opt/anaconda3」にインストールされてるanacondaのpythonが使えるように設定されてます