jupyter notebook添加Anaconda虚拟环境的python kernel
2017-11-22 21:18
891 查看
今天在工作的过程中遇到这样一个问题:安装完Anaconda利用conda创建了虚拟环境,但是启动jupyter notebook之后却找不到虚拟环境中的python kernel。后来上网找到了解决办法,如下:
利用这个命令便创建了一个名叫
保存,重启jupyter notebook。
重新启动之后发现确实多了一个为rqalpha的kernel,但是却始终启动不了这个kernel。后来发现是缺少ipykernel。于是利用如下命令安装:
至此,问题得到解决。
如果经常需要用jupyter notebook,那么最好在创建虚拟环境的时候便安装好ipykernel,命令如下:
创建虚拟环境
首先回顾一下当时创建虚拟环境的命令:conda create -n rqalpha python=3.5
利用这个命令便创建了一个名叫
rqalpha的虚拟环境。
jupyter notebook添加python kernel
在C:\Users\yinzm\AppData\Roaming\jupyter\kernels\下面创建一个文件夹,这个文件夹最好使用虚拟环境的名字,便于识别。然后在该文件夹下创建一个kernel.json文件,文件内容如下:
{ "language": "python", "display_name": "rqalpha", "argv": [ "D:\\Anaconda3\\envs\\rqalpha\\python.exe", "-m", "ipykernel_launcher", "-f", "{connection_file}" ] }
保存,重启jupyter notebook。
重新启动之后发现确实多了一个为rqalpha的kernel,但是却始终启动不了这个kernel。后来发现是缺少ipykernel。于是利用如下命令安装:
conda install -n rqalpha ipykernel
至此,问题得到解决。
如果经常需要用jupyter notebook,那么最好在创建虚拟环境的时候便安装好ipykernel,命令如下:
conda create -n rqalpha python=3.5 ipykernel
Reference
http://www.jianshu.com/p/f70ea020e6f9相关文章推荐
- jupyter notebook 添加python3 kernel
- anaconda jupyter notebook配置python3和python2两个版本
- windows下安装双版本anaconda,以及配置jupyter notebook的kernel
- python学习:anaconda 和 jupyter notebook by Sober
- jupyter notebook添加kernel
- Python使用seaborn包之路——下载包、更新anaconda3、jupyter notebook切换Python3
- jupyter notebook 安装多个版本kernel(python2 和python3)
- Python3+Mxnet+Anaconda+jupyter notebook安装
- Jupyter notebook中设定Kernel为Python2和Python3
- jupyter notebook添加kernel
- python︱Anaconda安装、简介(安装报错问题解决、Jupyter Notebook)
- Anaconda jupyter notebook 修改默认主目录(windows 环境)
- Jupyter notebook中设定Kernel为Python2和Python3
- Ubuntu16.04+Anaconda2下jupyter notebook kernel dead问题
- Python安装 Anaconda 以及jupyter notebook配置
- conda创建的虚拟环境中使用jupyter notebook如何关闭
- windows下安装双版本anaconda,以及配置jupyter notebook的kernel
- 用Docker在Ubuntu下 设置一个完整的Python + TensorFlow + GPU support + jupyter notebook + Deep Learning 开发环境
- jupyter notebook 添加新 kernel
- Mac下Jupyter(即IPython-notebook)的搭建及使用(更建议安装Anaconda环境直接自带jupyter notebook)