Linux
Installation
Use Virtual Env with Conda
# Each project should work in an independent virtual environment
conda search "^python$" # search a python distribution
conda create --name my_env python=3.9.1 # select a python distribution
# Activate: try these based on different os
source activate my_env
activate my_env # CMD
conda activate my_env # Linux
python --version # check python version
conda info --envs # check envs list
# if want to remove an env
conda remove --name my_env --all
~~# do not auto-activate base environment
conda config --set auto_activate_base False
# OR auto activate base environment
conda config --set auto_activate_base True~~
Update
# Update under base env
conda update conda # update conda
conda upng
Reinstall
# NOTE! always keep `requirments.txt` and `log.txt` in projects
pip freeze -> requirements.txt
# uninstall
rm -rf anaconda3
# remove from PATH, then install like above again
# recreate envs for projects by using `requirments.txt` and `log.txt`
pip install -r requirements.txt
Jupyter Notebook
# install nbextensions
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
# open
jupyter-notebook
# Enable TOC in nbxtension
Windows
下载
https://www.anaconda.com/
安装