# Anaconda Basic Command ###### tags: `python` :::spoiler **Quick Search** [TOC] ::: ## Create virtual environment ```command conda create --name $envname python=3.9(version) ``` ## Remove virtual environment ```command conda env remove --name $envname ``` ## conda重置或恢復base環境 ```command conda list --revisions conda install --rev 0 ``` :::info 第一條命令可以看到不同版本的歷史。 第二條命令的0代表要恢復到的版本。 ::: ## Check virtual environment list ``` conda env list ``` ## Activate env ``` activate env_name ``` ## Deactivate env ``` deactivate env_name ``` ## Check library list ``` pip list ``` ## Install toolkit ``` conda install toolkit_name ``` ``` pip install toolkit_name ``` ## Install requirements ``` pip install -r requirements.txt ``` ## Make requirements ``` pip freeze > requirements.txt ``` ## Jupyter notebook ### open the notebok ``` jupyter notebook ``` ### install toolkit in notebook ``` !pip install toolkit_name ``` ### show matplotlib figure in notebook ``` %matplotlib inline ```