Jupyter+venv

环境:Ubuntu18.04+python3.6.7

1. 虚拟环境的建立    

python -m venv pythonVenv

在当前目录下创建名为pythonVenv的虚拟环境

2.激活/切出环境

切换到pythonVenv的目录下

激活

source ./bin/activate

切出

deactivate

3.配置jupyter Kernel

source activate pythonVenv
pip install ipykernel
python -m ipykernel install --user --name pythonVenv --display-name "pythonVenv"
deactivate

然后打开jupyter notebook,就可以看到名为pythonVenv的python核心了

注:配置文件在~/.local/share/jupyter/kernel/目录下

  配置文件为 pythonVenv/kernel.json

猜你喜欢

转载自www.cnblogs.com/bigbigworf/p/10851458.html