簡體   English   中英

更新到 big sur 11.3 后找不到 conda

[英]conda not found after update to big sur 11.3

我最近將我的 2019 款 macbook pro 更新到了 macos big sur 11.3 版。 在更新之前,我安裝了 anaconda,創建了虛擬 python 3 個環境,安裝了 jupyter notebook,並將 conda 添加到我的 python 路徑變量中。 我能夠激活 conda env 並啟動 jupyter notebook 服務器。 我更新到 big sur 版本 11.3,現在當我嘗試使用 conda 做任何事情時,我得到的是:

-bash: conda: command not found

我看到一些帖子說這個問題可能是由於 zsh 是新的默認值引起的。 所以我嘗試了下面的命令。 還嘗試將我的默認終端切換到 zsh,但沒有任何效果。 所以我切換回bash。

有誰知道可能是什么問題,您能建議如何解決嗎?

試過:

/System/Volumes/Data/anaconda3/bin/conda init zsh

試過:

source /System/Volumes/Data/anaconda3/bin/activate

output:

-bash: /System/Volumes/Data/anaconda3/bin/conda: /anaconda3/bin/python: bad interpreter: No such file or directory

代碼:

vim ~/.bash_profile

output:

# added by Anaconda3 2019.03 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~   

更新:

我嘗試了下面鏈接中的第一個建議,

“來源/System/Volumes/Data/anaconda3/bin/activate”

但是沒有找到通常的conda。

Mas OS Big Sur 更新 - 未找到 Python3/conda/pip

我的 anaconda 家似乎位於上面帖子的第二個答案中提到的相同位置

“/系統/卷/數據/anaconda3”

所以也許這就是問題所在。

更新:

嘗試更新 bash_profile 中的路徑,如下所示

下面有錯誤

康達信息

-bash: /anaconda3/bin/conda: No such file or directory



# added by Anaconda3 2019.03 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/System/Volumes/Data/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/System/Volumes/Data/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/System/Volumes/Data/anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/System/Volumes/Data/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~    

                                  

嘗試找到所有 conda 所在的位置,然后相應地進行(即更改腳本中的路徑):

find / -name "*conda*" 2>/dev/null

所以經過多次谷歌搜索、黑客攻擊和咒罵之后,我在這個鏈接上找到了第二個解決方案:

Mas OS Big Sur 更新 - 未找到 Python3/conda/pip

移動你的anaconda3

運行前綴 rehome 工具

重新初始化你的conda

切換到 Monterey 並在其上下載 Anaconda 時,我遇到了同樣的問題。 嘗試了很多命令,但都失敗了,遇到了不同的問題,比如找不到 conda 命令/無法運行 python 腳本/無法重新安裝 Anaconda/python 等。我花了幾個小時才弄清楚最簡單的解決方案就是輸入“chsh - s /bin/zsh" 切換到 zsh...我什至不知道 bash 和 zsh 會導致這樣的問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM