---
# System prepended metadata

title: Conda環境管理相關指令

---

# Conda環境管理相關指令
### conda初始化
```
conda init
```
### conda建立虛擬環境
```
conda create -n <virtualenv> python=<version>
```
### list all conda envs
```
codna env list
```
### 指定env
```
conda activate <virtualenv>
conda deactivate # closing
```
### 安裝套件
```
conda install <package>
conda install -c conda-forge <package>
```
### conda移除虛擬環境
```
conda env remove -n <virtualenv>
```
### jupyter新增kernel及移除
```
ipython kernel install --name <virtualenv> --user
jupyter kernelspec list # list all kernels
jupyter kernelspec remove <virtualenv>
```
### 清理快取及其他檔案
```
conda clean -a # all file
            -i # index cache
            -p # packages
            -t # tarballs
            -c # tempfiles
            -l # logfiles
```