推 TuCH: 感覺是環境設定跑掉了 刪掉重裝吧 02/02 15:19
→ tiramisu0225: 已經重裝好多次了 .... 都一直出現這個問題 是mac系 02/02 17:39
→ tiramisu0225: 統的 02/02 17:39
→ TuCH: 沒辦法執行的很順暢是甚麼意思? 02/02 20:50
推 ddavid: 剛裝完也會出這個錯? 02/02 21:59
→ ddavid: 你應該移掉徹底重裝一次,然後說明清楚所謂剛裝完「好像不 02/02 22:00
→ ddavid: 能執行得很順暢」是怎麼個不順暢法,然後做了哪些事後會變 02/02 22:01
→ ddavid: 出base環境掛掉的問題,不然這個隔空抓不了藥XD 02/02 22:01
→ Hsins: 先 conda env list 看有沒有 base 02/03 03:02
謝謝三位大大的回覆詳細狀況如下:
狀況一:
假如在base的環境下執行 $conda update conda
還是出現 NoBaseEnvironmentError
狀況二:
在自己建立的環境下執行 $conda update conda
則是出現下面的錯誤訊息
PackageNotInstalledError: Package is not installed in prefix.
prefix: /Users/xxxxx/.conda/envs/finlab
package name: conda
To Hsins 大大:
執行env list的命令下面是有兩個環境的
# conda environments:
#
/Users/anaconda3
finlab /Users/xxxxx/.conda/envs/finlab
base * /opt/anaconda3
conda info
active environment : base
active env location : /opt/anaconda3
shell level : 1
user config file : /Users/xxxxx/.condarc
populated config files : /Users/xxxxx/.condarc
conda version : 4.7.12
conda-build version : 3.18.9
python version : 3.7.4.final.0
virtual packages :
base environment : /opt/anaconda3 (read only)
channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/osx-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /opt/anaconda3/pkgs
/Users/xxxxx/.conda/pkgs
envs directories : /Users/xxxxx/.conda/envs
/opt/anaconda3/envs
platform : osx-64
user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.4
Darwin/19.3.0 OSX/10.15.3
UID:GID : 501:20
netrc file : None
offline mode : False
P.s 請問使用MAC直接刪除就算乾淨了嗎? 還是要用其他的方法刪掉會更乾淨
因為第一次用不太熟悉操作,
謝謝三位大大的回覆 :)
※ 編輯: tiramisu0225 (114.24.81.165 臺灣), 02/03/2020 21:50:36
※ 編輯: tiramisu0225 (114.24.81.165 臺灣), 02/03/2020 21:54:14
→ Hsins: 我在 conda 的 GitHub issues 下面看到有類似的問題,看起 02/04 03:48
→ Hsins: 來是因為 /opt/anaconda3 只有 read 權限導致的。 02/04 03:49
→ Hsins: 嘗試看看透過 chmod 變更權限或 chown 變更擁有者看看 02/04 03:50
→ Hsins: sudo chmod +w -R /opt/anaconda3 02/04 03:51
→ Hsins: ----- 02/04 03:52
→ Hsins: 至於 mac OS 下要怎麼解除安裝軟體,老實說你如果不確定自 02/04 03:53
→ Hsins: 己(或軟體本身)動了哪些東西或新增修改了什麼文件,很難 02/04 03:53
→ Hsins: 回溯到安裝前的狀態。比如說你把 conda 刪掉了,但是你的 02/04 03:54
→ Hsins: .bashrc 或 .zshrc 裡面有增添路徑或是執行命令,這個就不 02/04 03:55
→ Hsins: 會隨著解除安裝之後刪除,就我所知如果你有運行 conda init 02/04 03:55
→ Hsins: 指令的話,conda 會在 shell 設定檔中添加一些內容。 02/04 03:55
→ Hsins: 至於其他軟體要解除安裝,就從 Application 資料夾下刪除 02/04 03:56
→ Hsins: ,然後去把 ~/Library/Application Support/ 下面對應的內 02/04 03:56
→ Hsins: 容刪掉就好了。 02/04 03:56
→ tiramisu0225: Hsins大大 謝謝您的回覆 我今天回去再測試看看 :) 02/04 11:07
→ gmccntzx1: 如果是這種情況的話,建議你從 ~/.bash_profile 去處理 02/04 14:15
→ gmccntzx1: 在 ~/.bash_profile 裡加入這兩行: 02/04 14:16
→ gmccntzx1: PATH=$HOME/anaconda3/bin:$PATH 02/04 14:17
→ gmccntzx1: export PATH 02/04 14:17
To Hsins大大:
剛剛執行了 $sudo chmod +w -R /opt/anaconda3
顯示chmod: -R: No such file or directory
To mgmccntzx1大大:
在~/.bash_profile裡面增加了
PATH=$HOME/anaconda3/bin:$PATH
export
source ~/.bash_profile 後
還是跟之前的狀況一樣
想不到只是灌個anaconda
心好累啊~
※ 編輯: tiramisu0225 (114.24.81.165 臺灣), 02/04/2020 19:08:44
→ Hsins: gmccntzx1 那邊做的事情只是將 conda 路徑放到系統環境變數 02/04 19:15
→ Hsins: 裡面,如果你有執行 conda init,他裡面的寫法會比較好一點 02/04 19:16
→ Hsins: 。直接自行添加環境變數並不是 conda 推薦的使用方式,因為 02/04 19:17
→ Hsins: 多數的 Unix-like 系統本身有一些執行檔是需要依靠系統本身 02/04 19:17
→ Hsins: 的 Python 直譯器。 02/04 19:17
→ Hsins: 如果是你說的狀況的話,我建議你到 opt 資料夾下面看看有沒 02/04 19:25
→ Hsins: 有 /anaconda3 的資料夾。 02/04 19:25
→ Hsins: 然後照你給的訊息來看,你似乎是把 conda 裝在使用者的目錄 02/04 19:26
→ Hsins: 下,也就是 /Users/anaconda3 下面。你可以用 which conda 02/04 19:28
→ Hsins: 檢查一下,如果是的話,你有兩個選擇: 02/04 19:28
→ Hsins: 1. 修改你 conda 的環境設定,把 base 改成現在的目錄 02/04 19:31
→ Hsins: 2. 在 /opt/anaconda3 下面創建一個 base 環境 02/04 19:31