-
安装
直接去官网下载 一路回车
官网 -
建立python虚拟环境 和我们平时一样 不同的是在建立完之后 要安装一个kernel
Using Python3 with pip and a virtual environmentpython3 -m venv my_environment_name # create a virtual environment source my_environment_name/bin/activate # activate the virtual environment python -m pip install ipykernel -i https://pypi.doubanio.com/simple/ # install the python kernel (ipykernel) into the virtual environment python -m ipykernel install
Using Python 2 with pip and a virtual environment
python -m pip install virtualenv # install a package for creating virtual environment cd my_project_folder # create a project folder virtualenv my_project # create a virtual environment source my_project/bin/activate # activate the virtual environment python -m pip install ipykernel -i https://pypi.doubanio.com/simple/ # install the python kernel (ipykernel) into the virtual environment python -m ipykernel install
-
使用这个py环境打开nteract
# 在环境激活的情况下 nteract -k python3
-
修改kernel名字,有很多kernel的话,都显示python3会导致分不清哪个是哪个,所以需要修改名字
安装完kernel 屏幕上显示➜ python3 -m ipykernel install Installed kernelspec python3 in /usr/local/share/jupyter/kernels/python3
进入这个路径 修改kernel.json 里的display name