conda手动初始化

问题:环境中存在conda但是conda无法使用

方法: 进入到anaconda目录下, 进入bin目录, 然后执行

bash 复制代码
 source activate

要想启动时自动进入conda环境, 需要在 ~/.bashrc中添加如下命令

bash 复制代码
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/root/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/root/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/root/miniconda3/etc/profile.d/conda.sh"
    else
        export PATH="/root/miniconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

然后 source ~/.bashrc

相关推荐
软萌萌的110 分钟前
Java Spring Boot 修改yml配置&加载顺序规则
java·spring boot·python
Dxy12393102161 小时前
Linux 编译安装 Python 3.12.10(多版本共存,不破坏系统Python)
linux·运维·python
持敬chijing2 小时前
Python概述
开发语言·python
赤羽尾风4 小时前
NumPy快速入门
python·numpy
倒流时光三十年4 小时前
第三阶段 26 · highlight 高亮(返回命中片段)
后端·python·django
久久学姐6 小时前
Python+Playwright+Pytest+BDD,用FSM打造高效测试框架
python·pytest·bdd·playwright·fsm
Zane19947 小时前
闭包到底"闭"住了什么?一文讲透 LEGB 规则与循环里的闭包陷阱
后端·python
Lumi_Peak7 小时前
Claude思考了42秒,我的代码质量直接提升了一个档次
python·claude
m沐沐7 小时前
【机器学习】DBSCAN聚类算法——原理、参数调优与实战
人工智能·python·深度学习·算法·机器学习·聚类·dbscan