conda更新到最新後,我的macos無法通過anaconda客戶端或者spyder命令打開spyder開發編輯器。
具體報錯信息如下
(base) x86_64-apple-darwin13% spyder
/Users/pluto/anaconda3/bin/pythonw: line 3: /Users/pluto/anaconda3/python.app/Contents/MacOS/python: No such file or directory
參考其它blog解決方案,以爲得到救命稻草
conda install -f python.app
但結果無效
=======================================苦苦======尋找=====================================
最終解決問題方法,參考Mac OS spyder won't launch: python.app directory mismatch(https://github.com/spyder-ide/spyder/issues/9951)
vi /Users/pluto/anaconda3/bin/pythonw # 發現目錄指向地址有問題
變動前,原始內容
#!/bin/bash
export PYTHONEXECUTABLE=/Users/pluto/anaconda3/bin/python
/Users/pluto/anaconda3/python.app/Contents/MacOS/python "$@"
修改後內容
#!/bin/bash
export PYTHONEXECUTABLE=/Users/pluto/anaconda3/bin/python
/Users/pluto/anaconda3/python.app/pythonapp/Contents/MacOS/python "$@"
注意目錄層級在python.app後多了pythonapp一級
ps:紙上得來終覺淺,深知此事要躬行