Mac系統安裝完Anaconda 3.7后在terminal輸入conda --version,返回command not found
原因可能是沒有配置環境變量
- 在terminal輸入vi ~/.bash_profile,檢查環境變量已配置
在terminal輸入export PATH=~/opt/anaconda3/bin:$PATH,當前有效,重啟terminal后失效- 在terminal輸入source ~/.bash_profile,當前有效,重啟terminal后失效
- 發現zsh加載的是 ~/.zshrc文件,而 ‘.zshrc’ 文件中並沒有定義任務環境變量
- 如果沒有 .zshrc 文件, 在相應目錄下執行 touch .zshrc 創建文件,添加 source ~/.bash_profile。 完美生效。
Ref:
