Jupyter 同时支持python二、python3 kernel

从docker hub 下载了一个 tensorFlow(debian linux) 镜像,可是里面只支持python2.7 kernel, 不支持python3 kernel.html

1. Notebook的右上角点new 只看到 python 2.7 kernel, 而后run 下面命令也能够证明python

[root@pydev pydev]# jupyter-kernelspec list Available kernels: python2 /usr/lib/python2.7/site-packages/ipykernel/resources

 

2. 那如何才能把python3 kernel 加进去呢?linux

1).首先看是否已经python3安装,查了是有的docker

2). 而后看是否有Python3对应的pip3centos

python3 -m pip --version

发现没有这个模块安全

 

3. 由于官方的 tensforflow/tensorflow 镜像是debian的,用下面命令下载pip3 (其余 linux 系统请自行 google 或者 baidu 参考其余相应文档)python2.7

 apt-get udpate
 apt
-get install python3-pip

 

4. 用pip3 安装Python3 kernelssh

python3 -m pip install ipykernel python3 -m ipykernel install --user

 

5. done.ui

  

 

 

另:google

Linux server上安装配置 Jupyter 请看 linux端安装Anaconda,方便远端访问jupyter

若是你的Linux server 在google cloud 上,请参考这里 教程 | 只需15分钟,使用谷歌云平台运行Jupyter Notebook 

 

Jupyter 怎么远程访问?


不记得之前怎么配置的,可是记得就是改了一个配置就好了,结果此次配置好像安全增强了,下面是一个经过ssh通道链接的方法,总以为直接在config 文件配置 ip='0.0.0.0' 不是更好吗,可是确实试了事后发现不行.

参考这里  https://ambermd.org/tutorials/analysis/tutorial_notebooks/remote_notebook/index.html的解决方案

ssh -N -f -L localhost:8000:localhost:8000 your_account@your_cluster_address

 

 

Reference:

  1. centos 7 install jupyter notebook, https://jupyter.org/install
    1.   
      $python3 -m pip install --upgrade pip $python3 -m pip install jupyter
      $jupyter notebook

       

  2. http://ipython.readthedocs.io/en/stable/install/kernel_install.html
  3. Centos 7 安装 python3 (不要卸载python2 由于yum 要用) https://phoenixnap.com/kb/how-to-install-python-3-centos-7
  4. Centos 7 安装python3 https://tecadmin.net/install-python-3-7-on-centos/
  5. Centos alternatives 控制多个版本的python https://linuxconfig.org/how-to-switch-between-python-versions-on-fedora-linux