查看Jupyter Notebook使用的是哪一個Python解釋器
import sys
print(sys.version)
print(sys.executable)
Jupyter Notebook內核指定的Python環境位置,在cmd(win+r)下輸入命令:
ipython kernelspec list
可以直接修改裏面的配置
更改pip源:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
可選國內源:
豆瓣:http://pypi.douban.com/simple/
中科大:https://pypi.mirrors.ustc.edu.cn/simple/
清華:https://pypi.tuna.tsinghua.edu.cn/simple
阿里雲 http://mirrors.aliyun.com/pypi/simple/
多個kernel安裝步驟如下:
創建python2.7版本虛擬環境
conda create -n env_name python=2.7
進入環境
activate env_name
添加到可選的kernel
pip install ipykernel
通過ipykernel爲jupyter添加python2.7環境
python -m ipykernel install --name env_name
關閉python2.7環境
deactivate
重新打開jupyter notebook可以看到python2.7版本的py27已經添加
刪除 jupyter 內核
jupyter kernelspec remove 'kernelname'