ubuntu安装conda

本文涉及的产品
实时计算 Flink 版,5000CU*H 3个月
检索分析服务 Elasticsearch 版,2核4GB开发者规格 1个月
大数据开发治理平台 DataWorks,不限时长
简介: ubuntu安装conda

实现目标

在 ubuntu 系统下安装 conda

参考资料

anaconda安装参考文档: https://docs.anaconda.com/free/anaconda/install/linux/

环境说明

系统环境: Ubuntu 22.04.3 LTS
安装用户使用 root 用户安装
安装版本 Anaconda3-2024.02-1
安装路径 /opt/anaconda3

安装步骤

  1. 下载 Anaconda3-2023.09-Linux-x86_64.sh
# Replace <INSTALLER_VERSION> with the version of the installer file you want to download
# For example, https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh
# All installers can be found at repo.anaconda.com/archive/
curl -O https://repo.anaconda.com/archive/Anaconda3-Anaconda3-2024.02-1-Linux-x86_64.sh
  1. 安装
bash Anaconda3-2023.09-Linux-x86_64.sh

# 成功后输出

Preparing transaction: done
Executing transaction: |

    Installed package of scikit-learn can be accelerated using scikit-learn-intelex.
    More details are available here: https://intel.github.io/scikit-learn-intelex

    For example:

        $ conda install scikit-learn-intelex
        $ python -m sklearnex my_application.py


                                                                                                                                                                                 done
installation finished.
Do you wish to update your shell profile to automatically initialize conda?
This will activate conda on startup and change the command prompt when activated.
If you'd prefer that conda's base environment not be activated on startup,
   run the following command when conda is activated:

conda config --set auto_activate_base false

You can undo this by running `conda init --reverse $SHELL`? [yes|no]
[no] >>> no

You have chosen to not have conda modify your shell scripts at all.
To activate conda's base environment in your current shell session:

eval "$(/opt/anaconda3/bin/conda shell.YOUR_SHELL_NAME hook)"

To install conda's shell functions for easier access, first activate, then:

conda init



# 静默安装
bash Anaconda3-2024.02-1-Linux-x86_64.sh -b -p /opt/anaconda3 -f
  1. 配置

cd /opt/anaconda3

./bin/conda init bash
cat .bashrc

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

回退 参考 ./bin/conda init --reverse bash

conda config --set auto_activate_base false

cat ~/.condarc
```bash
auto_activate_base: false

pkgs_dirs:

  • /data/anaconda3/pkgs
  • /opt/anaconda3/pkgs

envs_dirs:

  • /data/anaconda3/envs
    ```
  1. 创建环境
 conda create --name hello python=3.8

conda activate hello
conda deactivate

conda env remove --name hello
  1. 其他命令
    ```bash

conda env list

conda list
conda info
conda search
```

多环境问题解决

问题:前文说道我的安装用户是root, 安装后 conda env list 显示的是 还有其他用户创建的环境,看着有点奇怪,想去掉,但是不能影响其他用户

目录
相关文章
|
12天前
|
Ubuntu 编译器 Windows
ubuntu 18.04安装ftp为wordpress添加ftp
ubuntu 18.04安装ftp为wordpress添加ftp
|
3天前
|
存储 Ubuntu JavaScript
ubuntu安装npm环境
ubuntu安装npm环境
6 0
|
5天前
|
Ubuntu Java
蓝易云 - ubuntu22安装和部署Kettle8.2
现在你应该可以看到Kettle的图形界面了。这就完成了Ubuntu 22上Kettle 8.2的安装和部署。
9 1
|
6天前
|
Ubuntu 编译器 C语言
蓝易云 - ubuntu上安装boost库为SOMEIP的X86和ARM下编译做准备(编译两种版本)
以上就是在Ubuntu上安装Boost库并为SOME/IP的X86和ARM架构编译做准备的全部步骤。
17 0
|
10天前
|
Java 开发工具
Ubuntu18.04 安装jdk1.8
Ubuntu18.04 安装jdk1.8
|
11天前
|
Ubuntu Java Linux
Ubuntu20.04下载jdk遇到各种奇怪问题大集,Linux如何将默认的OpenJDK切换成自己安装的JDK版本(以JDK1.8为例),无需卸载原有OpenJDK,Some packages co
Ubuntu20.04下载jdk遇到各种奇怪问题大集,Linux如何将默认的OpenJDK切换成自己安装的JDK版本(以JDK1.8为例),无需卸载原有OpenJDK,Some packages co
|
11天前
|
NoSQL Ubuntu 安全
Ubuntu 20.04下载安装redis一条龙
Ubuntu 20.04下载安装redis一条龙
|
12天前
|
Ubuntu Linux Docker
windows 安装docker 安装Ubuntu linux
windows 安装docker 安装Ubuntu linux
|
12天前
|
Ubuntu Docker 容器
ubuntu 通过docker方式安装clouddrive2
ubuntu 通过docker方式安装clouddrive2
|
12天前
|
Ubuntu Java Linux
Linux centos7 ubuntu 一键安装Java JDK 脚本 shell 脚本
Linux centos7 ubuntu 一键安装Java JDK 脚本 shell 脚本

热门文章

最新文章