Create a new environment and specify the version of the python parser
conda create -n env_name python=3.6
View installed environment
conda env list
Activate the specified environment
conda activate env_name
Exit the current environment
conda deactivate
Query the installed python package of the specified environment
conda list -n env_name
Make Jupyter Notebook automatically associate the currently active environment
conda install nb_conda
Using Jupyter service, execute the following command in the terminal
jupyter notebook
Install the python package on the Jupyter interface, take the installation of numpy as an example:
import sys
# conda通用安装方式
!conda install --yes --prefix {sys.prefix} numpy
# pip通用安装方式
!{sys.executable} -m pip install numpy
Convert the .ipynb file to a .py file. After successful execution, a py file with the same name will be generated in the current directory
jupyter nbconvert --to script *.ipynb