ubuntu系统在bashrc文件中对conda进行启用设置

一、打开bashrc文件

bash 复制代码
vim ~/.bashrc

二、对于conda的设置

设置段落定义如下,设置为 true为开启使用 conda。

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

设置为 false为停止使用 conda。

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

设置完成后,激活环境参数。

bash 复制代码
source ~/.bashrc
相关推荐
Flash.kkl7 小时前
Linux——进程信号
运维·服务器
衫水8 小时前
ubuntu系统如何检查和安装以及运行redis
redis·ubuntu·bootstrap
苏宸啊8 小时前
Linux权限
linux·运维·服务器
多米Domi0118 小时前
0x3f第33天复习 (16;45-18:00)
数据结构·python·算法·leetcode·链表
Gofarlic_oms18 小时前
Windchill用户登录与模块访问失败问题排查与许可证诊断
大数据·运维·网络·数据库·人工智能
freepopo8 小时前
天津商业空间设计:材质肌理里的温度与质感[特殊字符]
python·材质
森叶8 小时前
Java 比 Python 高性能的原因:重点在高并发方面
java·开发语言·python
xqhoj8 小时前
Linux——make、makefile
linux·运维·服务器
文亭湖畔程序猿9 小时前
Debian 12 日常命令 & nano 快捷键速查表
运维·debian
张童瑶9 小时前
Linux 在线安装编译Python3.11
linux·运维·python3.11