软件介绍:

Anaconda包括Conda、Python以及一大堆安装好的包,比如:numpy、pandas等。
conda是一个开源的包、环境管理器,可以用于在同一个机器上安装不同版本的软件包及其依赖,并能够在不同的环境之间切换。

软件官网:

https://www.anaconda.com/products/individual

安装命令:

按官网修改最新版(Anaconda3-2021.05-Linux-x86_64.sh)
wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh
bash Anaconda3-2021.05-Linux-x86_64.sh

安装过程:

[root@ ~ ]# bash Anaconda3-2021.05-Linux-x86_64.sh

Welcome to Anaconda3 2021.05

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> 
===================================
End User License Agreement - Anaconda Individual Edition
===================================
Copyright 2015-2021, Anaconda, Inc.

......
....
省略
....
......

Please answer 'yes' or 'no':'
>>> yes

Anaconda3 will now be installed into this location:
/root/anaconda3
  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/root/anaconda3] >>> 
PREFIX=/root/anaconda3
Unpacking payload ...
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.
installation finished.

Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
[yes] >>> yes

If you'd prefer that conda's base environment not be activated on startup, 
   set the auto_activate_base parameter to false: 

conda config --set auto_activate_base false

Thank you for installing Anaconda3!

安装完成后,每次进入终端会默认使用conda环境,可以输入以下命令关闭默认进入conda:
conda config --set auto_activate_base false

至此,Anaconda安装完毕。终端输入conda确认

[root@ ~ ]# conda

usage: conda [-h] [-V] command ...
conda is a tool for managing and deploying applications, environments and packages.
Options
positional arguments:
  command
    clean        Remove unused packages and caches.
    compare      Compare packages between conda environments.
    ......
    ....
    省略

部分命令:

# 版本
conda --version
conda -V
# 创建一个环境
conda create --name tensorflow1_env python=3.6
# --name可以简写成-n
conda create -n tensorflow1_env python=3.6
# 显示环境列表
conda env list
conda info --env
# 简写成-e
conda info -e
# 查看tensorflow1_env 该环境安装哪些依赖
conda list -n tensorflow1_env
# 激活该环境
conda activate tensorflow1_env
# 在激活的环境里面查找tensorflow安装包的可用版本
conda search tensorflow
# 安装一个版本
conda install tensorflow==1.14.0
# 更新一个包
conda update numpy
# 删除环境(千万不要乱删除  )
conda remove -n tensorflow1_env --all
conda remove --name  tensorflow1_env --all
# 显示总的(当前环境)依赖list
conda list
# 清理无用包
conda clean -p
# 激活环境
conda activate
# 退出环境
conda deactivate

conda安装库时报错:

conda安装库时显示failed with initial frozen solve. Retrying with flexible solve.

解决方法:

输入conda update -n base conda
以及conda update --all

最后修改:2023 年 06 月 17 日
如果觉得我的文章对你有用,请随意赞赏