"Initialize Anaconda" 修訂間的差異

出自 DDCC TCAD TOOL Manual
前往: 導覽搜尋
(已建立頁面,內容為 "# List environments --------------- $ conda env list # Create environment with preinstalled packages --------------- $ conda create -n my_env numpy #create my...")
 
 
行 41: 行 41:
 
base * /Users/RAYMOND/anaconda3
 
base * /Users/RAYMOND/anaconda3
 
/Users/RAYMOND/miniconda3
 
/Users/RAYMOND/miniconda3
  +
  +
  +
管理套件
  +
  +
進入一個環境後,在開發過程中我們可能會發現有一些套件還需要安裝,可以採用以下的指令管理套件
  +
  +
安裝套件 conda install pkg_name1 pkg_name2 ...
  +
安裝套件指定版本 conda install pkg_name=version_number
  +
移除套件 conda remove pkg_name
  +
更新套件 conda update pkg_name
  +
更新所有套件 conda update -all
  +
列出所有已安裝套件 conda list
  +
清除安裝後下載的原始檔 conda clean -tp
  +
找尋套件 conda search pkg_name
  +
  +
# Install package ---------------
  +
conda install numpy
  +
conda install numpy scipy pandas
  +
  +
# Install package with specific version number ---------------
  +
conda install numpy=1.10
  +
  +
# Remove package ---------------
  +
conda remove package_name
  +
  +
# Update package ---------------
  +
conda update package_name
  +
  +
# Update all package ---------------
  +
conda update --all
  +
  +
# List installed packages ---------------
  +
conda list
  +
  +
# Clean up downloaded library ---------------
  +
$ conda clean -tp
  +
  +
# Search package ---------------
  +
conda search package_name
  +
  +
[[Others]]

於 2019年4月22日 (一) 21:24 的最新修訂

  1. List environments ---------------
$ conda env list


  1. Create environment with preinstalled packages ---------------
$ conda create -n my_env numpy  #create my_env, install numpy
$ conda create -n py2 python=2  #create py2, install python ver.=2
$ conda create -n py3 python=3  #create py3, install python ver.=3
$ conda env list 
base               *    /Users/RAYMOND/anaconda3
my_env                  /Users/RAYMOND/anaconda3/envs/my_env
py2                     /Users/RAYMOND/anaconda3/envs/py2
py3                     /Users/RAYMOND/anaconda3/envs/py3
                       /Users/RAYMOND/miniconda3       
 
# Enter environment ---------------
# * indicates which environment we are using
$ source activate py2
(py2) $ conda env list
base                    /Users/RAYMOND/anaconda3
my_env                  /Users/RAYMOND/anaconda3/envs/my_env
py2                *    /Users/RAYMOND/anaconda3/envs/py2
py3                     /Users/RAYMOND/anaconda3/envs/py3
                       /Users/RAYMOND/miniconda3
(py2) $ python
Python 2.7.14 |Anaconda, Inc.| (default, Mar 27 2018, 12:28:59)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>


  1. Exit environment ---------------
(py2) $ source deactivate


  1. Delete environment ---------------
$ conda env remove -n my_env
$ conda env remove -n py2
$ conda env remove -n py3
$ conda env list
base               *    /Users/RAYMOND/anaconda3
/Users/RAYMOND/miniconda3


管理套件

進入一個環境後,在開發過程中我們可能會發現有一些套件還需要安裝,可以採用以下的指令管理套件

   安裝套件 conda install pkg_name1 pkg_name2 ...
   安裝套件指定版本 conda install pkg_name=version_number
   移除套件 conda remove pkg_name
   更新套件 conda update pkg_name
   更新所有套件 conda update -all
   列出所有已安裝套件 conda list
   清除安裝後下載的原始檔 conda clean -tp
   找尋套件 conda search pkg_name
  1. Install package ---------------

conda install numpy conda install numpy scipy pandas

  1. Install package with specific version number ---------------

conda install numpy=1.10

  1. Remove package ---------------

conda remove package_name

  1. Update package ---------------

conda update package_name

  1. Update all package ---------------

conda update --all

  1. List installed packages ---------------

conda list

  1. Clean up downloaded library ---------------

$ conda clean -tp

  1. Search package ---------------

conda search package_name

Others