怎么用anaconda命令行?

anaconda命令行的简单使用:

1.查看conda有多少个子环境

conda info --envs
sunziheng:~ applery$ conda info --envsbase                  *  /Users/applery/anaconda3
py01_3.5                 /Users/applery/anaconda3/envs/py01_3.5

2.创建conda子环境

conda create --name py3.5_django11 python=3.5

py3.5_django11 : 虚拟环境的名字
python=3.5 : Python版本
如果python=3 这样会下载最高3.x的版本

sunziheng:~ applery$ conda create –name py3.5_django11 python=3.5
Solving environment: done
The following NEW packages will be INSTALLED:

   ca-certificates: 2018.03.07-0          
   certifi:         2018.8.24-py35_1      
   libcxx:          4.0.1-h579ed51_0      
   libcxxabi:       4.0.1-hebd6815_0      
   libedit:         3.1.20170329-hb402a30_2
   libffi:          3.2.1-h475c297_4      
   ncurses:         6.1-h0a44026_0        
   openssl:         1.0.2p-h1de35cc_0      
   pip:             10.0.1-py35_0          
   python:          3.5.6-hc167b69_0      
   readline:        7.0-h1de35cc_5        
   setuptools:      40.2.0-py35_0          
   sqlite:          3.25.2-ha441bb4_0      
   tk:              8.6.8-ha441bb4_0      
   wheel:           0.31.1-py35_0          
   xz:              5.2.4-h1de35cc_4      
   zlib:            1.2.11-hf3cbc9b_2      

Proceed ([y]/n)? y
下载完成后提示如何进入环境
#
# To activate this environment, use:
# > source activate py3.5_django11
#
# To deactivate an active environment, use:
# > source deactivate
查看子环境
sunziheng:~ applery$ conda info –envs
# conda environments:
#
base                  *  /Users/applery/anaconda3
py01_3.5                 /Users/applery/anaconda3/envs/py01_3.5
py3.5_django11           /Users/applery/anaconda3/envs/py3.5_django11

更多python知识,请关注python教程!!

来源:PY学习网:原文地址:https://www.py.cn/article.html

hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » 怎么用anaconda命令行?