Python 环境配置

Conda 常用命令

环境创建

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# 获取环境列表
conda info —-envs
# 创建环境
conda create --name myenv
# 通过yml导出/创建环境
conda env export > environment.yml
conda env create -f environment.yml
# 移除环境
conda env remove -n ENV_NAME


/* Clone environment */
conda list --explicit > spec-file.txt
conda create --name myenv --file spec-file.txt
conda install --name myenv --file spec-file.txt
/* Import packages */
pip install jupyter_contrib_nbextensions && jupyter contrib nbextension install 

Channels 管理

1
2
3
4
5
# channels 管理 
conda config --get channels
conda config --add(remove) channels http://conda.anaconda.org/mutirri
conda config --remove-key channels
conda config --add channels conda-forge

Jupyter

插件安装

安装``

1
2
3
4
5
6
7
8
conda install -c conda-forge jupyter_nbextensions_configurator
conda install -c conda-forge jupyter_contrib_nbextensions

# install jupyter-tabnine for auto-completion*
pip install jupyter-tabnine --user && jupyter nbextension install --py jupyter_tabnine --user && jupyter nbextension enable --py jupyter_tabnine --user && jupyter serverextension enable --py jupyter_tabnine --user

# uninstall
jupyter serverextension disable --py jupyter_tabnine && jupyter nbextension disable --py jupyter_tabnine  && jupyter nbextension uninstall --py jupyter_tabnine  && pip uninstall jupyter-tabnine 
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15

- pip install jupyterthemes
- jt  -t chesterish -N -kl -T   -cellw 100% -f meslo
- jt  -t grade3 -N -kl -T   -cellw 100% -f meslo


fuser -k 8888/tcp : kill jupyter notebook on server port 8888

- add following to \~/.jupyter/nbconfig/notebook.json to disable "autoCloseBrackets"

	  "CodeCell": {
	    "cm_config": {
	      "autoCloseBrackets": false
	    }
	  },
updatedupdated2023-06-052023-06-05
Update https-ca.md