conda常用命令介绍


❤️觉得内容不错的话,欢迎点赞收藏加关注,后续会继续输入更多优质内容❤️

conda常用命令介绍

基本命令和常见命令

Tip: 一般情况,–后面接长单词的参数等同于,-接单个字母的参数,我们可以将前面带有两个短线(–)的常用命令进行缩写(并不是所有的都可以缩写),方法是取一个短线和选项的首字母。例如 --name 可以缩写成 -n,–envs 可以缩写成 -e。

(1)查看conda版本信息

conda --version
conda -V
例如:
用户名@主机名:~# conda -V
conda 22.9.0

(2)查看帮助信息

conda --help
conda -h
例如:
conda -h
输出如下:
用户名@主机名:~# conda -h
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.
    config       Modify configuration values in .condarc. This is modeled after the git config command. Writes to the user .condarc file (/root/.condarc) by default. Use the --show-
                 sources flag to display all identified configuration locations on your computer.
    create       Create a new conda environment from a list of specified packages.
    info         Display information about current conda install.
    init         Initialize conda for shell interaction.
    install      Installs a list of packages into a specified conda environment.
    list         List installed packages in a conda environment.
    package      Low-level conda package utility. (EXPERIMENTAL)
    remove       Remove a list of packages from a specified conda environment.
    rename       Renames an existing environment.
    run          Run an executable in a conda environment.
    search       Search for packages and display associated information.The input is a MatchSpec, a query language for conda packages. See examples below.
    uninstall    Alias for conda remove.
    update       Updates conda packages to the latest compatible version.
    upgrade      Alias for conda update.
    notices      Retrieves latest channel notifications.

optional arguments:
  -h, --help     Show this help message and exit.
  -V, --version  Show the conda version number and exit.

conda commands available from other packages:
  build
  content-trust
  convert
  debug
  develop
  env
  index
  inspect
  metapackage
  pack
  render
  repo
  server
  skeleton
  token
  verify

(3)查看conda环境和环境基本信息

conda info #查看基本信息,例如:
conda info
输出如下:
用户名@主机名:/# conda info

     active environment : None
            shell level : 0
       user config file : /root/.condarc
 populated config files : 
          conda version : 22.9.0
    conda-build version : 3.22.0
         python version : 3.9.13.final.0
       virtual packages : __linux=5.4.0=0
                          __glibc=2.27=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /root/anaconda3  (writable)
      conda av data dir : /root/anaconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /root/anaconda3/pkgs
                          /root/.conda/pkgs
       envs directories : /root/anaconda3/envs
                          /root/.conda/envs
               platform : linux-64
             user-agent : conda/22.9.0 requests/2.28.1 CPython/3.9.13 Linux/5.4.0-125-generic ubuntu/18.04.6 glibc/2.27
                UID:GID : 0:0
             netrc file : None
           offline mode : False
conda info -e/--envs #查看conda安装的环境信息,例如:
用户名@主机名:/# conda info --envs
# conda environments:
#
base                     /root/anaconda3

(4)激活环境

conda activate [环境名称]
例如:
用户名@主机名:~# conda activate base
(base) 用户名@主机名:~# 

(5)退出环境

conda deactivate
例如:
(base) 用户名@主机名:~# conda deactivate
用户名@主机名:~# 

(6)安装python包

conda install [PackageName]
例如:
(base) 用户名@主机名:~# conda install numpy
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /root/anaconda3

  added / updated specs:
    - numpy


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    conda-22.11.0              |   py39h06a4308_1         927 KB
    ruamel.yaml-0.16.12        |   py39h5eee18b_3         172 KB
    ruamel.yaml.clib-0.2.6     |   py39h5eee18b_1         140 KB
    ------------------------------------------------------------
                                           Total:         1.2 MB

The following NEW packages will be INSTALLED:

  ruamel.yaml        pkgs/main/linux-64::ruamel.yaml-0.16.12-py39h5eee18b_3 None
  ruamel.yaml.clib   pkgs/main/linux-64::ruamel.yaml.clib-0.2.6-py39h5eee18b_1 None

The following packages will be UPDATED:

  conda                               22.9.0-py39h06a4308_0 --> 22.11.0-py39h06a4308_1 None


Proceed ([y]/n)? y


Downloading and Extracting Packages
ruamel.yaml-0.16.12  | 172 KB    | ############################################################################################################################################### | 100% 
ruamel.yaml.clib-0.2 | 140 KB    | ############################################################################################################################################### | 100% 
conda-22.11.0        | 927 KB    | ############################################################################################################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Retrieving notices: ...working... done

也可以给特定环境安装特定包

conda install --name [环境名称] [PackageName]
例如:
(base) 用户名@主机名:~# conda install --name base pandas
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

(7)删除python包

conda remove -n 环境名称] [PackageName]
例如:
(base) 用户名@主机名:~# conda remove -n base pandas
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /root/anaconda3

  removed specs:
    - pandas


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    asttokens-2.0.5            |     pyhd3eb1b0_0          20 KB
    attrs-22.1.0               |   py39h06a4308_0          85 KB
    ca-certificates-2022.10.11 |       h06a4308_0         124 KB
    certifi-2022.9.24          |   py39h06a4308_0         154 KB
    conda-package-handling-1.9.0|   py39h5eee18b_1         946 KB
    conda-repo-cli-1.0.24      |   py39h06a4308_0         115 KB
    cryptography-38.0.1        |   py39h9ce1e76_0         1.3 MB
    executing-0.8.3            |     pyhd3eb1b0_0          18 KB
    flit-core-3.6.0            |     pyhd3eb1b0_0          42 KB
    fontconfig-2.14.1          |       hef1e5e3_0         284 KB
    freetype-2.12.1            |       h4a9f257_0         626 KB
    idna-3.4                   |   py39h06a4308_0          93 KB
    ipython-8.6.0              |   py39h06a4308_0         1.0 MB
    jupyter_client-7.4.7       |   py39h06a4308_0         209 KB
    jupyter_core-4.11.2        |   py39h06a4308_0          80 KB
    jupyterlab-3.5.0           |   py39h06a4308_0         4.2 MB
    libtiff-4.4.0              |       hecacb30_2         526 KB
    libwebp-1.2.4              |       h11a3e52_0          79 KB
    libwebp-base-1.2.4         |       h5eee18b_0         347 KB
    nbclassic-0.4.8            |   py39h06a4308_0         5.8 MB
    notebook-6.5.2             |   py39h06a4308_0         511 KB
    notebook-shim-0.2.2        |   py39h06a4308_0          22 KB
    openssl-1.1.1s             |       h7f8727e_0         3.6 MB
    patchelf-0.15.0            |       h6a678d5_0          97 KB
    pkginfo-1.8.3              |   py39h06a4308_0          45 KB
    pure_eval-0.2.2            |     pyhd3eb1b0_0          14 KB
    pycosat-0.6.4              |   py39h5eee18b_0          84 KB
    readline-8.2               |       h5eee18b_0         357 KB
    setuptools-65.5.0          |   py39h06a4308_0         1.1 MB
    soupsieve-2.3.2.post1      |   py39h06a4308_0          65 KB
    sqlite-3.40.0              |       h5082296_0         1.2 MB
    stack_data-0.2.0           |     pyhd3eb1b0_0          22 KB
    toolz-0.12.0               |   py39h06a4308_0         105 KB
    tornado-6.2                |   py39h5eee18b_0         590 KB
    typing-extensions-4.4.0    |   py39h06a4308_0           8 KB
    typing_extensions-4.4.0    |   py39h06a4308_0          46 KB
    tzdata-2022f               |       h04d1e81_0         115 KB
    urllib3-1.26.12            |   py39h06a4308_0         181 KB
    xz-5.2.8                   |       h5eee18b_0         429 KB
    zlib-1.2.13                |       h5eee18b_0         103 KB
    ------------------------------------------------------------
                                           Total:        24.6 MB

The following NEW packages will be INSTALLED:

  asttokens          pkgs/main/noarch::asttokens-2.0.5-pyhd3eb1b0_0 
  executing          pkgs/main/noarch::executing-0.8.3-pyhd3eb1b0_0 
  flit-core          pkgs/main/noarch::flit-core-3.6.0-pyhd3eb1b0_0 
  notebook-shim      pkgs/main/linux-64::notebook-shim-0.2.2-py39h06a4308_0 
  pure_eval          pkgs/main/noarch::pure_eval-0.2.2-pyhd3eb1b0_0 
  stack_data         pkgs/main/noarch::stack_data-0.2.0-pyhd3eb1b0_0 

The following packages will be REMOVED:

  alabaster-0.7.12-pyhd3eb1b0_0
  anaconda-2022.10-py39_0
  anaconda-project-0.11.1-py39h06a4308_0
  appdirs-1.4.4-pyhd3eb1b0_0
  arrow-1.2.2-pyhd3eb1b0_0
  astroid-2.11.7-py39h06a4308_0
  astropy-5.1-py39h7deecbd_0
  atomicwrites-1.4.0-py_0
  automat-20.2.0-py_0
  autopep8-1.6.0-pyhd3eb1b0_1
  bcrypt-3.2.0-py39h5eee18b_1
  binaryornot-0.4.4-pyhd3eb1b0_1
  bitarray-2.5.1-py39h5eee18b_0
  bkcharts-0.2-py39h06a4308_1
  black-22.6.0-py39h06a4308_0
  blosc-1.21.0-h4ff587b_1
  bokeh-2.4.3-py39h06a4308_0
  boto3-1.24.28-py39h06a4308_0
  botocore-1.27.28-py39h06a4308_0
  bottleneck-1.3.5-py39h7deecbd_0
  brotli-1.0.9-h5eee18b_7
  brotli-bin-1.0.9-h5eee18b_7
  brunsli-0.1-h2531618_0
  c-ares-1.18.1-h7f8727e_0
  cfitsio-3.470-h5893167_7
  charls-2.2.0-h2531618_0
  cloudpickle-2.0.0-pyhd3eb1b0_0
  colorama-0.4.5-py39h06a4308_0
  colorcet-3.0.0-py39h06a4308_0
  conda-pack-0.6.0-pyhd3eb1b0_0
  constantly-15.1.0-pyh2b92418_0
  cookiecutter-1.7.3-pyhd3eb1b0_0
  cssselect-1.1.0-pyhd3eb1b0_0
  curl-7.84.0-h5eee18b_0
  cycler-0.11.0-pyhd3eb1b0_0
  cython-0.29.32-py39h6a678d5_0
  cytoolz-0.11.0-py39h27cfd23_0
  daal4py-2021.6.0-py39h79cecc1_1
  dal-2021.6.0-hdb19cb5_916
  dask-2022.7.0-py39h06a4308_0
  dask-core-2022.7.0-py39h06a4308_0
  dataclasses-0.8-pyh6d0b6a4_7
  datashader-0.14.1-py39h06a4308_0
  datashape-0.5.4-py39h06a4308_1
  diff-match-patch-20200713-pyhd3eb1b0_0
  dill-0.3.4-pyhd3eb1b0_0
  distributed-2022.7.0-py39h06a4308_0
  docutils-0.18.1-py39h06a4308_3
  et_xmlfile-1.1.0-py39h06a4308_0
  fftw-3.3.9-h27cfd23_1
  flake8-4.0.1-pyhd3eb1b0_1
  flask-1.1.2-pyhd3eb1b0_0
  fonttools-4.25.0-pyhd3eb1b0_0
  fsspec-2022.7.1-py39h06a4308_0
  gensim-4.1.2-py39h295c915_0
  gmp-6.2.1-h295c915_3
  gmpy2-2.1.2-py39heeb90bb_0
  greenlet-1.1.1-py39h295c915_0
  h5py-3.7.0-py39h737f45e_0
  hdf5-1.10.6-h3ffc7dd_1
  heapdict-1.0.1-pyhd3eb1b0_0
  holoviews-1.15.0-py39h06a4308_0
  hvplot-0.8.0-py39h06a4308_0
  hyperlink-21.0.0-pyhd3eb1b0_0
  imagecodecs-2021.8.26-py39hf0132c2_1
  imageio-2.19.3-py39h06a4308_0
  imagesize-1.4.1-py39h06a4308_0
  importlib-metadata-4.11.3-py39h06a4308_0
  importlib_metadata-4.11.3-hd3eb1b0_0
  incremental-21.3.0-pyhd3eb1b0_0
  inflection-0.5.1-py39h06a4308_0
  iniconfig-1.1.1-pyhd3eb1b0_0
  intake-0.6.5-pyhd3eb1b0_0
  intervaltree-3.1.0-pyhd3eb1b0_0
  isort-5.9.3-pyhd3eb1b0_0
  itemadapter-0.3.0-pyhd3eb1b0_0
  itemloaders-1.0.4-pyhd3eb1b0_1
  itsdangerous-2.0.1-pyhd3eb1b0_0
  jdcal-1.4.1-pyhd3eb1b0_0
  jeepney-0.7.1-pyhd3eb1b0_0
  jellyfish-0.9.0-py39h7f8727e_0
  jinja2-time-0.2.0-pyhd3eb1b0_3
  jmespath-0.10.0-pyhd3eb1b0_0
  joblib-1.1.0-pyhd3eb1b0_0
  jq-1.6-h27cfd23_1000
  jupyter-1.0.0-py39h06a4308_8
  jupyter_console-6.4.3-pyhd3eb1b0_0
  jxrlib-1.1-h7b6447c_2
  keyring-23.4.0-py39h06a4308_0
  kiwisolver-1.4.2-py39h295c915_0
  lazy-object-proxy-1.6.0-py39h27cfd23_0
  libaec-1.0.4-he6710b0_1
  libbrotlicommon-1.0.9-h5eee18b_7
  libbrotlidec-1.0.9-h5eee18b_7
  libbrotlienc-1.0.9-h5eee18b_7
  libcurl-7.84.0-h91b91d3_0
  libev-4.33-h7f8727e_1
  libgfortran-ng-11.2.0-h00389a5_1
  libgfortran5-11.2.0-h1234567_1
  libidn2-2.3.2-h7f8727e_0
  libllvm11-11.1.0-h9e868ea_5
  libnghttp2-1.46.0-hce63b2e_0
  libspatialindex-1.9.3-h2531618_0
  libssh2-1.10.0-h8f2d780_0
  libunistring-0.9.10-h27cfd23_0
  libuuid-1.0.3-h7f8727e_2
  libzopfli-1.0.3-he6710b0_0
  llvmlite-0.38.0-py39h4ff587b_0
  locket-1.0.0-py39h06a4308_0
  lxml-4.9.1-py39h1edc446_0
  lz4-3.1.3-py39h27cfd23_0
  lzo-2.10-h7b6447c_2
  markdown-3.3.4-py39h06a4308_0
  matplotlib-3.5.2-py39h06a4308_0
  matplotlib-base-3.5.2-py39hf590b9c_0
  mccabe-0.7.0-pyhd3eb1b0_0
  mock-4.0.3-pyhd3eb1b0_0
  mpc-1.1.0-h10f8cd9_1
  mpfr-4.0.2-hb69a4c5_1
  mpi-1.0-mpich
  mpich-3.3.2-external_0
  mpmath-1.2.1-py39h06a4308_0
  msgpack-python-1.0.3-py39hd09550d_0
  multipledispatch-0.6.0-py39h06a4308_0
  munkres-1.1.4-py_0
  mypy_extensions-0.4.3-py39h06a4308_1
  networkx-2.8.4-py39h06a4308_0
  nltk-3.7-pyhd3eb1b0_0
  nose-1.3.7-pyhd3eb1b0_1008
  numba-0.55.1-py39h51133e4_0
  numexpr-2.8.3-py39h807cd23_0
  numpydoc-1.4.0-py39h06a4308_0
  olefile-0.46-pyhd3eb1b0_0
  oniguruma-6.9.7.1-h27cfd23_0
  openjpeg-2.4.0-h3ad879b_0
  openpyxl-3.0.10-py39h5eee18b_0
  pandas-1.4.4-py39h6a678d5_0
  panel-0.13.1-py39h06a4308_0
  param-1.12.0-pyhd3eb1b0_0
  parsel-1.6.0-py39h06a4308_0
  partd-1.2.0-pyhd3eb1b0_1
  pathspec-0.9.0-py39h06a4308_0
  patsy-0.5.2-py39h06a4308_1
  pep8-1.7.1-py39h06a4308_1
  platformdirs-2.5.2-py39h06a4308_0
  plotly-5.9.0-py39h06a4308_0
  poyo-0.5.0-pyhd3eb1b0_0
  prompt_toolkit-3.0.20-hd3eb1b0_0
  protego-0.1.16-py_0
  py-1.11.0-pyhd3eb1b0_0
  pyasn1-0.4.8-pyhd3eb1b0_0
  pyasn1-modules-0.2.8-py_0
  pycodestyle-2.8.0-pyhd3eb1b0_0
  pyct-0.4.8-py39h06a4308_1
  pycurl-7.45.1-py39h8f2d780_0
  pydispatcher-2.0.5-py39h06a4308_2
  pydocstyle-6.1.1-pyhd3eb1b0_0
  pyerfa-2.0.0-py39h27cfd23_0
  pyflakes-2.4.0-pyhd3eb1b0_0
  pyhamcrest-2.0.2-pyhd3eb1b0_2
  pylint-2.14.5-py39h06a4308_0
  pyls-spyder-0.4.0-pyhd3eb1b0_0
  pyodbc-4.0.34-py39h6a678d5_0
  pyqtwebengine-5.15.7-py39h6a678d5_1
  pytables-3.6.1-py39h77479fe_1
  pytest-7.1.2-py39h06a4308_0
  python-lsp-black-1.2.1-py39h06a4308_0
  python-lsp-jsonrpc-1.0.0-pyhd3eb1b0_0
  python-lsp-server-1.5.0-py39h06a4308_0
  python-slugify-5.0.2-pyhd3eb1b0_0
  python-snappy-0.6.0-py39h2531618_3
  pyviz_comms-2.0.2-pyhd3eb1b0_0
  pywavelets-1.3.0-py39h7f8727e_0
  pyxdg-0.27-pyhd3eb1b0_0
  qdarkstyle-3.0.2-pyhd3eb1b0_0
  qstylizer-0.1.10-pyhd3eb1b0_0
  qt-5.15.9-h06a4308_0
  qtawesome-1.0.3-pyhd3eb1b0_0
  qtconsole-5.3.2-py39h06a4308_0
  queuelib-1.5.0-py39h06a4308_0
  regex-2022.7.9-py39h5eee18b_0
  requests-file-1.5.1-pyhd3eb1b0_0
  rope-0.22.0-pyhd3eb1b0_0
  rtree-0.9.7-py39h06a4308_1
  ruamel_yaml-0.15.100-py39h27cfd23_0
  s3transfer-0.6.0-py39h06a4308_0
  scikit-image-0.19.2-py39h51133e4_0
  scikit-learn-1.0.2-py39h51133e4_1
  scikit-learn-intelex-2021.6.0-py39h06a4308_0
  scipy-1.9.1-py39h14f4228_0
  scrapy-2.6.2-py39h06a4308_0
  seaborn-0.11.2-pyhd3eb1b0_0
  secretstorage-3.3.1-py39h06a4308_0
  service_identity-18.1.0-pyhd3eb1b0_1
  smart_open-5.2.1-py39h06a4308_0
  snappy-1.1.9-h295c915_0
  snowballstemmer-2.2.0-pyhd3eb1b0_0
  sortedcollections-2.1.0-pyhd3eb1b0_0
  sortedcontainers-2.4.0-pyhd3eb1b0_0
  sphinx-5.0.2-py39h06a4308_0
  sphinxcontrib-applehelp-1.0.2-pyhd3eb1b0_0
  sphinxcontrib-devhelp-1.0.2-pyhd3eb1b0_0
  sphinxcontrib-htmlhelp-2.0.0-pyhd3eb1b0_0
  sphinxcontrib-jsmath-1.0.1-pyhd3eb1b0_0
  sphinxcontrib-qthelp-1.0.3-pyhd3eb1b0_0
  sphinxcontrib-serializinghtml-1.1.5-pyhd3eb1b0_0
  spyder-5.3.3-py39h06a4308_0
  spyder-kernels-2.3.3-py39h06a4308_0
  sqlalchemy-1.4.39-py39h5eee18b_0
  statsmodels-0.13.2-py39h7f8727e_0
  sympy-1.10.1-py39h06a4308_0
  tabulate-0.8.10-py39h06a4308_0
  tbb-2021.6.0-hdb19cb5_0
  tbb4py-2021.6.0-py39hdb19cb5_0
  tblib-1.7.0-pyhd3eb1b0_0
  tenacity-8.0.1-py39h06a4308_1
  text-unidecode-1.3-pyhd3eb1b0_0
  textdistance-4.2.1-pyhd3eb1b0_0
  threadpoolctl-2.2.0-pyh0d69192_0
  three-merge-0.1.1-pyhd3eb1b0_0
  tifffile-2021.7.2-pyhd3eb1b0_2
  tinycss-0.4-pyhd3eb1b0_1002
  tldextract-3.2.0-pyhd3eb1b0_0
  tomlkit-0.11.1-py39h06a4308_0
  twisted-22.2.0-py39h5eee18b_1
  unidecode-1.2.0-pyhd3eb1b0_0
  unixodbc-2.3.11-h5eee18b_0
  w3lib-1.21.0-pyhd3eb1b0_0
  watchdog-2.1.6-py39h06a4308_0
  werkzeug-2.0.3-pyhd3eb1b0_0
  wget-1.21.3-h0b77cf5_0
  whatthepatch-1.0.2-py39h06a4308_0
  wrapt-1.14.1-py39h5eee18b_0
  wurlitzer-3.0.2-py39h06a4308_0
  xarray-0.20.1-pyhd3eb1b0_1
  xlrd-2.0.1-pyhd3eb1b0_0
  xlsxwriter-3.0.3-pyhd3eb1b0_0
  yapf-0.31.0-pyhd3eb1b0_0
  zfp-0.5.5-h295c915_6
  zict-2.1.0-py39h06a4308_0
  zipp-3.8.0-py39h06a4308_0
  zope-1.0-py39h06a4308_1
  zope.interface-5.4.0-py39h7f8727e_0

The following packages will be UPDATED:

  attrs              pkgs/main/noarch::attrs-21.4.0-pyhd3e~ --> pkgs/main/linux-64::attrs-22.1.0-py39h06a4308_0 
  ca-certificates                     2022.07.19-h06a4308_0 --> 2022.10.11-h06a4308_0 
  certifi                          2022.9.14-py39h06a4308_0 --> 2022.9.24-py39h06a4308_0 
  conda-package-han~                   1.9.0-py39h5eee18b_0 --> 1.9.0-py39h5eee18b_1 
  conda-repo-cli                      1.0.20-py39h06a4308_0 --> 1.0.24-py39h06a4308_0 
  cryptography                        37.0.1-py39h9ce1e76_0 --> 38.0.1-py39h9ce1e76_0 
  fontconfig                              2.13.1-h6c09931_0 --> 2.14.1-hef1e5e3_0 
  freetype                                2.11.0-h70c0345_0 --> 2.12.1-h4a9f257_0 
  idna               pkgs/main/noarch::idna-3.3-pyhd3eb1b0~ --> pkgs/main/linux-64::idna-3.4-py39h06a4308_0 
  ipython                             7.31.1-py39h06a4308_1 --> 8.6.0-py39h06a4308_0 
  jupyter_client                       7.3.4-py39h06a4308_0 --> 7.4.7-py39h06a4308_0 
  jupyter_core                        4.11.1-py39h06a4308_0 --> 4.11.2-py39h06a4308_0 
  jupyterlab                           3.4.4-py39h06a4308_0 --> 3.5.0-py39h06a4308_0 
  libtiff                                  4.4.0-hecacb30_0 --> 4.4.0-hecacb30_2 
  libwebp                                  1.2.2-h55f646e_0 --> 1.2.4-h11a3e52_0 
  libwebp-base                             1.2.2-h7f8727e_0 --> 1.2.4-h5eee18b_0 
  nbclassic          pkgs/main/noarch::nbclassic-0.3.5-pyh~ --> pkgs/main/linux-64::nbclassic-0.4.8-py39h06a4308_0 
  notebook                            6.4.12-py39h06a4308_0 --> 6.5.2-py39h06a4308_0 
  openssl                                 1.1.1q-h7f8727e_0 --> 1.1.1s-h7f8727e_0 
  patchelf                                  0.13-h295c915_0 --> 0.15.0-h6a678d5_0 
  pkginfo            pkgs/main/noarch::pkginfo-1.8.2-pyhd3~ --> pkgs/main/linux-64::pkginfo-1.8.3-py39h06a4308_0 
  pycosat                              0.6.3-py39h27cfd23_0 --> 0.6.4-py39h5eee18b_0 
  readline                                 8.1.2-h7f8727e_1 --> 8.2-h5eee18b_0 
  setuptools                          63.4.1-py39h06a4308_0 --> 65.5.0-py39h06a4308_0 
  soupsieve          pkgs/main/noarch::soupsieve-2.3.1-pyh~ --> pkgs/main/linux-64::soupsieve-2.3.2.post1-py39h06a4308_0 
  sqlite                                  3.39.3-h5082296_0 --> 3.40.0-h5082296_0 
  toolz              pkgs/main/noarch::toolz-0.11.2-pyhd3e~ --> pkgs/main/linux-64::toolz-0.12.0-py39h06a4308_0 
  tornado                                6.1-py39h27cfd23_0 --> 6.2-py39h5eee18b_0 
  typing-extensions                    4.3.0-py39h06a4308_0 --> 4.4.0-py39h06a4308_0 
  typing_extensions                    4.3.0-py39h06a4308_0 --> 4.4.0-py39h06a4308_0 
  tzdata                                   2022c-h04d1e81_0 --> 2022f-h04d1e81_0 
  urllib3                            1.26.11-py39h06a4308_0 --> 1.26.12-py39h06a4308_0 
  xz                                       5.2.6-h5eee18b_0 --> 5.2.8-h5eee18b_0 
  zlib                                    1.2.12-h5eee18b_3 --> 1.2.13-h5eee18b_0 


Proceed ([y]/n)? y


Downloading and Extracting Packages
                                                                                                                                                                                          
Preparing transaction: done                                                                                                                                                               
Verifying transaction: done                                                                                                                                                               
Executing transaction: done

(8)创建python环境

详见第四章

常用命令详解

(1)conda info

conda info [-a] [--base] [-e] [-s] [--unsafe-channels]

选项:

-a, -all: 查看所有信息(不常用)。
–base:查看基环境所在路径。
-e, --envs:列出当前所有的 conda 环境。
-s, --system:列出所有的环境变量(不常用)。
–unsafe-channels:查看令牌公开的频道。

(2)conda create

conda create [-n 环境名称 | -p path] [--clone 环境名称] [-c channel_address] [PackageName]

选项:

-n, --name:我们可以根据环境名称来创建一个 conda 环境。
-p, --prefix:除了根据名称创建环境以外,我们还可以根据地址来创建 conda 环境。
–clone:--clone 主要用来克隆(复制)现有的环境。
-c, --channel:首先来介绍一下什么是 conda 频道。

(3)conda install

conda install [-n 环境名称 | -p path] [-c channel_address] [PackageName]

选项:

-n, --name:安装PackageName包的环境名称。
-p:也可以不指定环境名称,指定环境的绝对路径。
-c, --channel:频道地址,一般不指定的话默认即可。

(4)conda remove

conda uninstall 是 conda remove 的别名,我们也可以使用 conda uninstall 来移除包,方法是相同的。

conda remove [-n 环境名称 | -p path] [PackageName] [--all]

选项:

-n, --name:移除PackageName包的环境名称。
-p:也可以不指定环境名称,指定环境的绝对路径。
--all:卸载全部。

(5)conda list

conda list [-n 环境名称 | -p path] [PackageName]

选项:

-n, --name:查看python环境的环境名称。
-p:也可以不指定环境名称,指定环境的绝对路径。

(6)conda search

conda search 用来搜索指定的包。

conda search [-c channel_address] [-f] [PackageName]

选项

-c, --channel:指定的搜索频道地址。

(7)conda update

conda update 用来将一系列的包升级到最新版本。

conda update [-n 环境名称 | -p path] [PackageName] [--all]

选项:

-n, --name:移除PackageName包的环境名称。
-p:也可以不指定环境名称,指定环境的绝对路径。
--all:卸载全部。

(8)conda config

conda config 用来配置 conda 的频道,相关信息会存储在 /用户名/.condarc 文件中。

conda config --add channels [channel_address]
conda config --get                          #显示所有的配置
conda config --get [key1] [key2]            #显示指定配置
conda config --add [key] [value]            #添加新配置
conda config --set [key] [value]            #设置配置
conda config --remove [key] [value]         #删除一个配置
conda config --remove-key [key]             #删除一个key
conda config --help                         #查看帮助信息
conda config --set show_channel_urls true

参考文献

[1] anaconda https://baike.baidu.com/item/anaconda/20407441
https://www.anaconda.com
[2] 初学 Python 者自学 Anaconda 的正确姿势是什么?https://zhuanlan.zhihu.com/p/32925500
[3] Anaconda介绍、安装及使用教程 https://zhuanlan.zhihu.com/p/32925500
[4] conda常用命令汇总 https://blog.csdn.net/raelum/article/details/125109819
[5] Conda介绍 https://blog.csdn.net/koflance/article/details/78582737


❤️觉得内容不错的话,欢迎点赞收藏加关注,后续会继续输入更多优质内容❤️

你可能感兴趣的:(conda,python,开发语言)