当前位置:   article > 正文

Anaconda------环境管理_warning: a newer version of conda exists. <== curr

warning: a newer version of conda exists. <== current version: 4.5.4 latest

Anaconda 中的Conda核心功能就是包管理和环境管理,可以根据需要安装不同版本的python,而且能自由切换。

先着重介绍一个概念--虚拟环境(virtual environment),

它是一个虚拟化,从电脑独立开辟出来的环境。以Docker为例,在Docker世界里,虚拟环境就是借助docker来把一部分内容独立出来,我们把这部分独立出来的东西称作“容器”,在这个容器中,我们可以只安装我们需要的依赖包,各个容器之间互相隔离,互不影响。比如,我们需要用到Django,可以做一个Django的虚拟环境,里面只需要安装Django相关包就可以了,当需要Scrapy时,可以创建Scrapy的虚拟环境,里面只需要安装Scrapy相关包。

其实我个人认为虚拟环境这个概念中的“虚拟”一词并不准确,可能用子环境这个词比较贴切一些,虽然说是虚拟环境,但是需要安装的包还是要真实的安装,就像一个Centos虚拟机本质上还是一个Centos系统,只是借助于VirtualBox容器来运行一样,Anaconda中的每个定义的虚拟环境都有一个确定的磁盘位置,在这里就体现为一个具体的目录,比如我的虚拟环境都在/usr/lib64/anaconda3/envs目录下,环境的名字就是目录的名字,各个虚拟环境里需要的相关包也是在各自的目录下。

另外在实际工作中,不同的项目可能使用相同的组件但是版本不同,比如airflow1.x和airflow2.x,或者是某些项目需要运行在python2.7,另一些项目需要3.6,等等诸如此类和版本有关的事务,可以解决anaconda的环境管理都可以一一解决掉。


1. 创建新环境

下面就创建一个名为python36的新环境,并且指定python版本是3.6 不用管是3.6.x,conda会为我们自动寻找3.6.x中的最新版本。

conda create --name python36 python=3.6

下面是详细的安装过程 :

  1. Solving environment: done
  2. ==> WARNING: A newer version of conda exists. <==
  3. current version: 4.5.4
  4. latest version: 4.10.3
  5. Please update conda by running
  6. $ conda update -n base conda
  7. ## Package Plan ##
  8. environment location: /usr/lib64/anaconda3/envs/python36
  9. added / updated specs:
  10. - python=3.6
  11. The following packages will be downloaded:
  12. package | build
  13. ---------------------------|-----------------
  14. _libgcc_mutex-0.1 | main 3 KB
  15. wheel-0.37.0 | pyhd3eb1b0_1 31 KB
  16. libgcc-ng-9.1.0 | hdf63c60_0 8.1 MB
  17. libstdcxx-ng-9.1.0 | hdf63c60_0 4.0 MB
  18. xz-5.2.5 | h7b6447c_0 438 KB
  19. zlib-1.2.11 | h7b6447c_3 120 KB
  20. python-3.6.13 | h12debd9_1 32.5 MB
  21. readline-8.1 | h27cfd23_0 464 KB
  22. openssl-1.1.1l | h7f8727e_0 3.8 MB
  23. certifi-2021.5.30 | py36h06a4308_0 141 KB
  24. setuptools-58.0.4 | py36h06a4308_0 979 KB
  25. pip-21.2.2 | py36h06a4308_0 2.1 MB
  26. ld_impl_linux-64-2.35.1 | h7274673_9 637 KB
  27. ncurses-6.2 | he6710b0_1 1.1 MB
  28. sqlite-3.36.0 | hc218d9a_0 1.4 MB
  29. ca-certificates-2021.9.30 | h06a4308_1 123 KB
  30. libffi-3.3 | he6710b0_2 54 KB
  31. tk-8.6.11 | h1ccaba5_0 3.2 MB
  32. ------------------------------------------------------------
  33. Total: 59.2 MB
  34. The following NEW packages will be INSTALLED:
  35. _libgcc_mutex: 0.1-main
  36. ca-certificates: 2021.9.30-h06a4308_1
  37. certifi: 2021.5.30-py36h06a4308_0
  38. ld_impl_linux-64: 2.35.1-h7274673_9
  39. libffi: 3.3-he6710b0_2
  40. libgcc-ng: 9.1.0-hdf63c60_0
  41. libstdcxx-ng: 9.1.0-hdf63c60_0
  42. ncurses: 6.2-he6710b0_1
  43. openssl: 1.1.1l-h7f8727e_0
  44. pip: 21.2.2-py36h06a4308_0
  45. python: 3.6.13-h12debd9_1
  46. readline: 8.1-h27cfd23_0
  47. setuptools: 58.0.4-py36h06a4308_0
  48. sqlite: 3.36.0-hc218d9a_0
  49. tk: 8.6.11-h1ccaba5_0
  50. wheel: 0.37.0-pyhd3eb1b0_1
  51. xz: 5.2.5-h7b6447c_0
  52. zlib: 1.2.11-h7b6447c_3
  53. Proceed ([y]/n)?
  54. Downloading and Extracting Packages
  55. _libgcc_mutex-0.1 | 3 KB | ############################################################################## | 100%
  56. wheel-0.37.0 | 31 KB | ############################################################################## | 100%
  57. libgcc-ng-9.1.0 | 8.1 MB | ############################################################################## | 100%
  58. libstdcxx-ng-9.1.0 | 4.0 MB | ############################################################################## | 100%
  59. xz-5.2.5 | 438 KB | ############################################################################## | 100%
  60. zlib-1.2.11 | 120 KB | ############################################################################## | 100%
  61. python-3.6.13 | 32.5 MB | ############################################################################## | 100%
  62. readline-8.1 | 464 KB | ############################################################################## | 100%
  63. openssl-1.1.1l | 3.8 MB | ############################################################################## | 100%
  64. certifi-2021.5.30 | 141 KB | ############################################################################## | 100%
  65. setuptools-58.0.4 | 979 KB | ############################################################################## | 100%
  66. pip-21.2.2 | 2.1 MB | ############################################################################## | 100%
  67. ld_impl_linux-64-2.3 | 637 KB | ############################################################################## | 100%
  68. ncurses-6.2 | 1.1 MB | ############################################################################## | 100%
  69. sqlite-3.36.0 | 1.4 MB | ############################################################################## | 100%
  70. ca-certificates-2021 | 123 KB | ############################################################################## | 100%
  71. libffi-3.3 | 54 KB | ############################################################################## | 100%
  72. tk-8.6.11 | 3.2 MB | ############################################################################## | 100%
  73. Preparing transaction: done
  74. Verifying transaction: done
  75. Executing transaction: done
  76. #
  77. # To activate this environment, use:
  78. # > source activate python36
  79. #
  80. # To deactivate an active environment, use:
  81. # > source deactivate
  82. #
  83. [root@localhost backup]#
  84. [root@localhost backup]#

这个名为python36的新环境位置是/usr/lib64/anaconda3/envs/python36
并且列出将要下载的相关包的名称和大小,这里active environment显示为Node,表示目前还没有及活动的环境,如果激活了某个环境然后执行conda info 这里会显示出环境的名称。
这里安装的速度比较快是因为之前安装Anaconda时设置了Anaconda仓库的镜像,因为Anaconda.org的服务器在国外,所以需要安装packages时,会发现conda下载的速度经常很慢,幸亏清华TUNA镜像源有Anaconda仓库的镜像,需要将其加入conda的配置即可。

  1. # 添加Anaconda的TUNA镜像
  2. conda config --add channels https : //mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  3. # 设置搜索时显示通道地址
  4. conda config --set show_channel_urls yes

2. 查看conda环境
  

  conda info
 下面是没有进入python36这个小环境之前看到的信息

  1. [root@localhost backup]# conda info
  2. active environment : None
  3. user config file : /root/.condarc
  4. populated config files : /root/.condarc
  5. conda version : 4.5.4
  6. conda-build version : 3.10.5
  7. python version : 3.6.5.final.0
  8. base environment : /usr/lib64/anaconda3 (writable)
  9. channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
  10. https://repo.anaconda.com/pkgs/main/noarch
  11. https://repo.anaconda.com/pkgs/free/linux-64
  12. https://repo.anaconda.com/pkgs/free/noarch
  13. https://repo.anaconda.com/pkgs/r/linux-64
  14. https://repo.anaconda.com/pkgs/r/noarch
  15. https://repo.anaconda.com/pkgs/pro/linux-64
  16. https://repo.anaconda.com/pkgs/pro/noarch
  17. package cache : /usr/lib64/anaconda3/pkgs
  18. /root/.conda/pkgs
  19. envs directories : /usr/lib64/anaconda3/envs
  20. /root/.conda/envs
  21. platform : linux-64
  22. user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.5 Linux/3.10.0-327.el7.x86_64 centos/7 glibc/2.17
  23. UID:GID : 0:0
  24. netrc file : None
  25. offline mode : False
  26. [root@localhost backup]#

这个命令会详细列出conda的所有环境信息,可以看到创建的新环境处于/usr/lib64/anaconda3/envs/,其实用ls 也能查看到这个目录
 

  1. [root@localhost backup]# ls /usr/lib64/anaconda3/envs/
  2. python36

 如果只是用来查看新建的环境,可以使用conda info --even 或者conda -e

  1. [root@localhost backup]# conda info --envs
  2. # conda environments:
  3. #
  4. base * /usr/lib64/anaconda3
  5. python36 /usr/lib64/anaconda3/envs/python36
  6. [root@localhost backup]# conda info -e
  7. # conda environments:
  8. #
  9. base * /usr/lib64/anaconda3
  10. python36 /usr/lib64/anaconda3/envs/python36
  11. [root@localhost backup]#

base表示conda基础的默认环境,python36是刚才新建的环境。

3. 激活指定的环境

在linux下,激活环境使用source active xxxxxx,如果是在windows则使用active xxxxxx

  1. [root@localhost backup]# source activate python36
  2. (python36) [root@localhost backup]# ll
  3. total 636472
  4. -rwxr-xr-x. 1 root root 651745206 Oct 13 04:44 Anaconda3-5.2.0-Linux-x86_64.sh
  5. (python36) [root@localhost backup]#

上面已经激活了python36这个环境,(python36)显示了当前的环境名称,我们验证一下这个环境的情况:

  1. (python36) [root@localhost backup]# python
  2. Python 3.6.13 |Anaconda, Inc.| (default, Jun 4 2021, 14:25:59)
  3. [GCC 7.5.0] on linux
  4. Type "help", "copyright", "credits" or "license" for more information.
  5. >>>

可以看到这个环境中的python的版本是3.6.13,第1部分创建环境时,下载了新的python,版本就是python-3.6.13。

在看看pip的版本情况:

  1. (python36) [root@localhost backup]# pip --version
  2. pip 21.2.2 from /usr/lib64/anaconda3/envs/python36/lib/python3.6/site-packages/pip (python 3.6)
  3. (python36) [root@localhost backup]#

这里的版本是pip 21.2.2,也是新环境中的版本,如果安装了新的包那么就会处于python36这个先环境下面。

此时再查看环境
 

  1. (python36) [root@localhost envs]# conda info
  2. active environment : python36
  3. active env location : /usr/lib64/anaconda3/envs/python36
  4. shell level : 1
  5. user config file : /root/.condarc
  6. populated config files : /root/.condarc
  7. conda version : 4.5.4
  8. conda-build version : 3.10.5
  9. python version : 3.6.5.final.0
  10. base environment : /usr/lib64/anaconda3 (writable)
  11. channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
  12. https://repo.anaconda.com/pkgs/main/noarch
  13. https://repo.anaconda.com/pkgs/free/linux-64
  14. https://repo.anaconda.com/pkgs/free/noarch
  15. https://repo.anaconda.com/pkgs/r/linux-64
  16. https://repo.anaconda.com/pkgs/r/noarch
  17. https://repo.anaconda.com/pkgs/pro/linux-64
  18. https://repo.anaconda.com/pkgs/pro/noarch
  19. package cache : /usr/lib64/anaconda3/pkgs
  20. /root/.conda/pkgs
  21. envs directories : /usr/lib64/anaconda3/envs
  22. /root/.conda/envs
  23. platform : linux-64
  24. user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.5 Linux/3.10.0-327.el7.x86_64 centos/7 glibc/2.17
  25. UID:GID : 0:0
  26. netrc file : None
  27. offline mode : False
  28. (python36) [root@localhost envs]#

可以看到 active environment : python36,表示当前激活的环境是python36


4. 退出当前的环境

conda deactivate
 

  1. (python36) [root@localhost backup]# conda deactivate
  2. [root@localhost backup]# pip --version
  3. pip 10.0.1 from /usr/lib64/anaconda3/lib/python3.6/site-packages/pip (python 3.6)
  4. [root@localhost backup]#

退出python36环境之后查看外面的pip版本,可以看到版本是10.0.1,说明外面环境下的pip版本确实比新环境python36下的版本低好多,由此可以看出环境管理的的意义非凡。

5. 列出指定环境下安装的包
 

命令:conda list
这个命令本身就是列出conda中安装的包,只是在指定的小环境中可以列出当前环境下安装的包。
 

  1. (python36) [root@localhost backup]# conda list
  2. # packages in environment at /usr/lib64/anaconda3/envs/python36:
  3. #
  4. # Name Version Build Channel
  5. _libgcc_mutex 0.1 main defaults
  6. ca-certificates 2021.9.30 h06a4308_1 defaults
  7. certifi 2021.5.30 py36h06a4308_0 defaults
  8. ld_impl_linux-64 2.35.1 h7274673_9 defaults
  9. libffi 3.3 he6710b0_2 defaults
  10. libgcc-ng 9.1.0 hdf63c60_0 defaults
  11. libstdcxx-ng 9.1.0 hdf63c60_0 defaults
  12. ncurses 6.2 he6710b0_1 defaults
  13. openssl 1.1.1l h7f8727e_0 defaults
  14. pip 21.2.2 py36h06a4308_0 defaults
  15. python 3.6.13 h12debd9_1 defaults
  16. readline 8.1 h27cfd23_0 defaults
  17. setuptools 58.0.4 py36h06a4308_0 defaults
  18. sqlite 3.36.0 hc218d9a_0 defaults
  19. tk 8.6.11 h1ccaba5_0 defaults
  20. wheel 0.37.0 pyhd3eb1b0_1 defaults
  21. xz 5.2.5 h7b6447c_0 defaults
  22. zlib 1.2.11 h7b6447c_3 defaults
  23. (python36) [root@localhost backup]#

 退出python36环境,看看外面环境中conda里面的包

  1. [root@localhost backup]# conda list
  2. # packages in environment at /usr/lib64/anaconda3:
  3. #
  4. # Name Version Build Channel
  5. _ipyw_jlab_nb_ext_conf 0.1.0 py36he11e457_0 defaults
  6. alabaster 0.7.10 py36h306e16b_0 defaults
  7. anaconda 5.2.0 py36_3 defaults
  8. anaconda-client 1.6.14 py36_0 defaults
  9. anaconda-navigator 1.8.7 py36_0 defaults
  10. anaconda-project 0.8.2 py36h44fb852_0 defaults
  11. asn1crypto 0.24.0 py36_0 defaults
  12. astroid 1.6.3 py36_0 defaults
  13. astropy 3.0.2 py36h3010b51_1 defaults
  14. attrs 18.1.0 py36_0 defaults
  15. babel 2.5.3 py36_0 defaults
  16. backcall 0.1.0 py36_0 defaults
  17. backports 1.0 py36hfa02d7e_1 defaults
  18. backports.shutil_get_terminal_size 1.0.0 py36hfea85ff_2 defaults
  19. beautifulsoup4 4.6.0 py36h49b8c8c_1 defaults
  20. bitarray 0.8.1 py36h14c3975_1 defaults
  21. bkcharts 0.2 py36h735825a_0 defaults
  22. blas 1.0 mkl defaults
  23. blaze 0.11.3 py36h4e06776_0 defaults
  24. bleach 2.1.3 py36_0 defaults
  25. blosc 1.14.3 hdbcaa40_0 defaults
  26. bokeh 0.12.16 py36_0 defaults
  27. boto 2.48.0 py36h6e4cd66_1 defaults
  28. bottleneck 1.2.1 py36haac1ea0_0 defaults
  29. bzip2 1.0.6 h14c3975_5 defaults
  30. ca-certificates 2018.03.07 0 defaults
  31. cairo 1.14.12 h7636065_2 defaults
  32. certifi 2018.4.16 py36_0 defaults
  33. cffi 1.11.5 py36h9745a5d_0 defaults
  34. chardet 3.0.4 py36h0f667ec_1 defaults
  35. click 6.7 py36h5253387_0 defaults
  36. cloudpickle 0.5.3 py36_0 defaults
  37. clyent 1.2.2 py36h7e57e65_1 defaults
  38. colorama 0.3.9 py36h489cec4_0 defaults
  39. conda 4.5.4 py36_0 defaults
  40. conda-build 3.10.5 py36_0 defaults
  41. conda-env 2.6.0 h36134e3_1 defaults
  42. conda-verify 2.0.0 py36h98955d8_0 defaults
  43. contextlib2 0.5.5 py36h6c84a62_0 defaults
  44. cryptography 2.2.2 py36h14c3975_0 defaults
  45. curl 7.60.0 h84994c4_0 defaults
  46. cycler 0.10.0 py36h93f1223_0 defaults
  47. cython 0.28.2 py36h14c3975_0 defaults
  48. cytoolz 0.9.0.1 py36h14c3975_0 defaults
  49. dask 0.17.5 py36_0 defaults
  50. dask-core 0.17.5 py36_0 defaults
  51. datashape 0.5.4 py36h3ad6b5c_0 defaults
  52. dbus 1.13.2 h714fa37_1 defaults
  53. decorator 4.3.0 py36_0 defaults
  54. distributed 1.21.8 py36_0 defaults
  55. docutils 0.14 py36hb0f60f5_0 defaults
  56. entrypoints 0.2.3 py36h1aec115_2 defaults
  57. et_xmlfile 1.0.1 py36hd6bccc3_0 defaults
  58. expat 2.2.5 he0dffb1_0 defaults
  59. fastcache 1.0.2 py36h14c3975_2 defaults
  60. filelock 3.0.4 py36_0 defaults
  61. flask 1.0.2 py36_1 defaults
  62. flask-cors 3.0.4 py36_0 defaults
  63. fontconfig 2.12.6 h49f89f6_0 defaults
  64. freetype 2.8 hab7d2ae_1 defaults
  65. get_terminal_size 1.0.0 haa9412d_0 defaults
  66. gevent 1.3.0 py36h14c3975_0 defaults
  67. glib 2.56.1 h000015b_0 defaults
  68. glob2 0.6 py36he249c77_0 defaults
  69. gmp 6.1.2 h6c8ec71_1 defaults
  70. gmpy2 2.0.8 py36hc8893dd_2 defaults
  71. graphite2 1.3.11 h16798f4_2 defaults
  72. greenlet 0.4.13 py36h14c3975_0 defaults
  73. gst-plugins-base 1.14.0 hbbd80ab_1 defaults
  74. gstreamer 1.14.0 hb453b48_1 defaults
  75. h5py 2.7.1 py36ha1f6525_2 defaults
  76. harfbuzz 1.7.6 h5f0a787_1 defaults
  77. hdf5 1.10.2 hba1933b_1 defaults
  78. heapdict 1.0.0 py36_2 defaults
  79. html5lib 1.0.1 py36h2f9c1c0_0 defaults
  80. icu 58.2 h9c2bf20_1 defaults
  81. idna 2.6 py36h82fb2a8_1 defaults
  82. imageio 2.3.0 py36_0 defaults
  83. imagesize 1.0.0 py36_0 defaults
  84. intel-openmp 2018.0.0 8 defaults
  85. ipykernel 4.8.2 py36_0 defaults
  86. ipython 6.4.0 py36_0 defaults
  87. ipython_genutils 0.2.0 py36hb52b0d5_0 defaults
  88. ipywidgets 7.2.1 py36_0 defaults
  89. isort 4.3.4 py36_0 defaults
  90. itsdangerous 0.24 py36h93cc618_1 defaults
  91. jbig 2.1 hdba287a_0 defaults
  92. jdcal 1.4 py36_0 defaults
  93. jedi 0.12.0 py36_1 defaults
  94. jinja2 2.10 py36ha16c418_0 defaults
  95. jpeg 9b h024ee3a_2 defaults
  96. jsonschema 2.6.0 py36h006f8b5_0 defaults
  97. jupyter 1.0.0 py36_4 defaults
  98. jupyter_client 5.2.3 py36_0 defaults
  99. jupyter_console 5.2.0 py36he59e554_1 defaults
  100. jupyter_core 4.4.0 py36h7c827e3_0 defaults
  101. jupyterlab 0.32.1 py36_0 defaults
  102. jupyterlab_launcher 0.10.5 py36_0 defaults
  103. kiwisolver 1.0.1 py36h764f252_0 defaults
  104. lazy-object-proxy 1.3.1 py36h10fcdad_0 defaults
  105. libcurl 7.60.0 h1ad7b7a_0 defaults
  106. libedit 3.1.20170329 h6b74fdf_2 defaults
  107. libffi 3.2.1 hd88cf55_4 defaults
  108. libgcc-ng 7.2.0 hdf63c60_3 defaults
  109. libgfortran-ng 7.2.0 hdf63c60_3 defaults
  110. libpng 1.6.34 hb9fc6fc_0 defaults
  111. libsodium 1.0.16 h1bed415_0 defaults
  112. libssh2 1.8.0 h9cfc8f7_4 defaults
  113. libstdcxx-ng 7.2.0 hdf63c60_3 defaults
  114. libtiff 4.0.9 he85c1e1_1 defaults
  115. libtool 2.4.6 h544aabb_3 defaults
  116. libxcb 1.13 h1bed415_1 defaults
  117. libxml2 2.9.8 h26e45fe_1 defaults
  118. libxslt 1.1.32 h1312cb7_0 defaults
  119. llvmlite 0.23.1 py36hdbcaa40_0 defaults
  120. locket 0.2.0 py36h787c0ad_1 defaults
  121. lxml 4.2.1 py36h23eabaa_0 defaults
  122. lzo 2.10 h49e0be7_2 defaults
  123. markupsafe 1.0 py36hd9260cd_1 defaults
  124. matplotlib 2.2.2 py36h0e671d2_1 defaults
  125. mccabe 0.6.1 py36h5ad9710_1 defaults
  126. mistune 0.8.3 py36h14c3975_1 defaults
  127. mkl 2018.0.2 1 defaults
  128. mkl-service 1.1.2 py36h17a0993_4 defaults
  129. mkl_fft 1.0.1 py36h3010b51_0 defaults
  130. mkl_random 1.0.1 py36h629b387_0 defaults
  131. more-itertools 4.1.0 py36_0 defaults
  132. mpc 1.0.3 hec55b23_5 defaults
  133. mpfr 3.1.5 h11a74b3_2 defaults
  134. mpmath 1.0.0 py36hfeacd6b_2 defaults
  135. msgpack-python 0.5.6 py36h6bb024c_0 defaults
  136. multipledispatch 0.5.0 py36_0 defaults
  137. navigator-updater 0.2.1 py36_0 defaults
  138. nbconvert 5.3.1 py36hb41ffb7_0 defaults
  139. nbformat 4.4.0 py36h31c9010_0 defaults
  140. ncurses 6.1 hf484d3e_0 defaults
  141. networkx 2.1 py36_0 defaults
  142. nltk 3.3.0 py36_0 defaults
  143. nose 1.3.7 py36hcdf7029_2 defaults
  144. notebook 5.5.0 py36_0 defaults
  145. numba 0.38.0 py36h637b7d7_0 defaults
  146. numexpr 2.6.5 py36h7bf3b9c_0 defaults
  147. numpy 1.14.3 py36hcd700cb_1 defaults
  148. numpy-base 1.14.3 py36h9be14a7_1 defaults
  149. numpydoc 0.8.0 py36_0 defaults
  150. odo 0.5.1 py36h90ed295_0 defaults
  151. olefile 0.45.1 py36_0 defaults
  152. openpyxl 2.5.3 py36_0 defaults
  153. openssl 1.0.2o h20670df_0 defaults
  154. packaging 17.1 py36_0 defaults
  155. pandas 0.23.0 py36h637b7d7_0 defaults
  156. pandoc 1.19.2.1 hea2e7c5_1 defaults
  157. pandocfilters 1.4.2 py36ha6701b7_1 defaults
  158. pango 1.41.0 hd475d92_0 defaults
  159. parso 0.2.0 py36_0 defaults
  160. partd 0.3.8 py36h36fd896_0 defaults
  161. patchelf 0.9 hf79760b_2 defaults
  162. path.py 11.0.1 py36_0 defaults
  163. pathlib2 2.3.2 py36_0 defaults
  164. patsy 0.5.0 py36_0 defaults
  165. pcre 8.42 h439df22_0 defaults
  166. pep8 1.7.1 py36_0 defaults
  167. pexpect 4.5.0 py36_0 defaults
  168. pickleshare 0.7.4 py36h63277f8_0 defaults
  169. pillow 5.1.0 py36h3deb7b8_0 defaults
  170. pip 10.0.1 py36_0 defaults
  171. pixman 0.34.0 hceecf20_3 defaults
  172. pkginfo 1.4.2 py36_1 defaults
  173. pluggy 0.6.0 py36hb689045_0 defaults
  174. ply 3.11 py36_0 defaults
  175. prompt_toolkit 1.0.15 py36h17d85b1_0 defaults
  176. psutil 5.4.5 py36h14c3975_0 defaults
  177. ptyprocess 0.5.2 py36h69acd42_0 defaults
  178. py 1.5.3 py36_0 defaults
  179. pycodestyle 2.4.0 py36_0 defaults
  180. pycosat 0.6.3 py36h0a5515d_0 defaults
  181. pycparser 2.18 py36hf9f622e_1 defaults
  182. pycrypto 2.6.1 py36h14c3975_8 defaults
  183. pycurl 7.43.0.1 py36hb7f436b_0 defaults
  184. pyflakes 1.6.0 py36h7bd6a15_0 defaults
  185. pygments 2.2.0 py36h0d3125c_0 defaults
  186. pylint 1.8.4 py36_0 defaults
  187. pyodbc 4.0.23 py36hf484d3e_0 defaults
  188. pyopenssl 18.0.0 py36_0 defaults
  189. pyparsing 2.2.0 py36hee85983_1 defaults
  190. pyqt 5.9.2 py36h751905a_0 defaults
  191. pysocks 1.6.8 py36_0 defaults
  192. pytables 3.4.3 py36h02b9ad4_2 defaults
  193. pytest 3.5.1 py36_0 defaults
  194. pytest-arraydiff 0.2 py36_0 defaults
  195. pytest-astropy 0.3.0 py36_0 defaults
  196. pytest-doctestplus 0.1.3 py36_0 defaults
  197. pytest-openfiles 0.3.0 py36_0 defaults
  198. pytest-remotedata 0.2.1 py36_0 defaults
  199. python 3.6.5 hc3d631a_2 defaults
  200. python-dateutil 2.7.3 py36_0 defaults
  201. pytz 2018.4 py36_0 defaults
  202. pywavelets 0.5.2 py36he602eb0_0 defaults
  203. pyyaml 3.12 py36hafb9ca4_1 defaults
  204. pyzmq 17.0.0 py36h14c3975_0 defaults
  205. qt 5.9.5 h7e424d6_0 defaults
  206. qtawesome 0.4.4 py36h609ed8c_0 defaults
  207. qtconsole 4.3.1 py36h8f73b5b_0 defaults
  208. qtpy 1.4.1 py36_0 defaults
  209. readline 7.0 ha6073c6_4 defaults
  210. requests 2.18.4 py36he2e5f8d_1 defaults
  211. rope 0.10.7 py36h147e2ec_0 defaults
  212. ruamel_yaml 0.15.35 py36h14c3975_1 defaults
  213. scikit-image 0.13.1 py36h14c3975_1 defaults
  214. scikit-learn 0.19.1 py36h7aa7ec6_0 defaults
  215. scipy 1.1.0 py36hfc37229_0 defaults
  216. seaborn 0.8.1 py36hfad7ec4_0 defaults
  217. send2trash 1.5.0 py36_0 defaults
  218. setuptools 39.1.0 py36_0 defaults
  219. simplegeneric 0.8.1 py36_2 defaults
  220. singledispatch 3.4.0.3 py36h7a266c3_0 defaults
  221. sip 4.19.8 py36hf484d3e_0 defaults
  222. six 1.11.0 py36h372c433_1 defaults
  223. snappy 1.1.7 hbae5bb6_3 defaults
  224. snowballstemmer 1.2.1 py36h6febd40_0 defaults
  225. sortedcollections 0.6.1 py36_0 defaults
  226. sortedcontainers 1.5.10 py36_0 defaults
  227. sphinx 1.7.4 py36_0 defaults
  228. sphinxcontrib 1.0 py36h6d0f590_1 defaults
  229. sphinxcontrib-websupport 1.0.1 py36hb5cb234_1 defaults
  230. spyder 3.2.8 py36_0 defaults
  231. sqlalchemy 1.2.7 py36h6b74fdf_0 defaults
  232. sqlite 3.23.1 he433501_0 defaults
  233. statsmodels 0.9.0 py36h3010b51_0 defaults
  234. sympy 1.1.1 py36hc6d1c1c_0 defaults
  235. tblib 1.3.2 py36h34cf8b6_0 defaults
  236. terminado 0.8.1 py36_1 defaults
  237. testpath 0.3.1 py36h8cadb63_0 defaults
  238. tk 8.6.7 hc745277_3 defaults
  239. toolz 0.9.0 py36_0 defaults
  240. tornado 5.0.2 py36_0 defaults
  241. traitlets 4.3.2 py36h674d592_0 defaults
  242. typing 3.6.4 py36_0 defaults
  243. unicodecsv 0.14.1 py36ha668878_0 defaults
  244. unixodbc 2.3.6 h1bed415_0 defaults
  245. urllib3 1.22 py36hbe7ace6_0 defaults
  246. wcwidth 0.1.7 py36hdf4376a_0 defaults
  247. webencodings 0.5.1 py36h800622e_1 defaults
  248. werkzeug 0.14.1 py36_0 defaults
  249. wheel 0.31.1 py36_0 defaults
  250. widgetsnbextension 3.2.1 py36_0 defaults
  251. wrapt 1.10.11 py36h28b7045_0 defaults
  252. xlrd 1.1.0 py36h1db9f0c_1 defaults
  253. xlsxwriter 1.0.4 py36_0 defaults
  254. xlwt 1.3.0 py36h7b00a1f_0 defaults
  255. xz 5.2.4 h14c3975_4 defaults
  256. yaml 0.1.7 had09818_2 defaults
  257. zeromq 4.2.5 h439df22_0 defaults
  258. zict 0.1.3 py36h3a3bf81_0 defaults
  259. zlib 1.2.11 ha838bed_2 defaults
  260. [root@localhost backup]#

可以看到比python36环境下的包多了好多。

6. 删除指定的环境

 
命令:conda env remove --name myenv 
执行这个命令会删除指定的环境


7. 在conda下查看指定环境的包

如果处于conda下而非某个指定的环境下,普通的conda list会列所有的包,此时如果想要查看某个指定的环境下的包,可以使用下面的命令
conda list -n xxxxx
例如要查看python36这个环境下的包

  1. [root@localhost ~]# conda list -n python36
  2. # packages in environment at /usr/lib64/anaconda3/envs/python36:
  3. #
  4. # Name Version Build Channel
  5. _libgcc_mutex 0.1 main defaults
  6. ca-certificates 2021.9.30 h06a4308_1 defaults
  7. certifi 2021.5.30 py36h06a4308_0 defaults
  8. ld_impl_linux-64 2.35.1 h7274673_9 defaults
  9. libffi 3.3 he6710b0_2 defaults
  10. libgcc-ng 9.1.0 hdf63c60_0 defaults
  11. libstdcxx-ng 9.1.0 hdf63c60_0 defaults
  12. ncurses 6.2 he6710b0_1 defaults
  13. openssl 1.1.1l h7f8727e_0 defaults
  14. pip 21.2.2 py36h06a4308_0 defaults
  15. python 3.6.13 h12debd9_1 defaults
  16. readline 8.1 h27cfd23_0 defaults
  17. setuptools 58.0.4 py36h06a4308_0 defaults
  18. sqlite 3.36.0 hc218d9a_0 defaults
  19. tk 8.6.11 h1ccaba5_0 defaults
  20. wheel 0.37.0 pyhd3eb1b0_1 defaults
  21. xz 5.2.5 h7b6447c_0 defaults
  22. zlib 1.2.11 h7b6447c_3 defaults
  23. [root@localhost ~]#

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号