joh*_*tis 6 python ipython ipython-notebook ipython-parallel jupyter
我为Python 3安装了IPython 3,以便与Jupyterhub一起使用.
现在我可以使用带有Python2内核的笔记本,因为我创建了 /usr/local/share/jupyter/kernels/python2/kernel.json
有:
{
"argv": ["python2", "-m", "IPython.kernel",
"-f", "{connection_file}"],
"display_name": "Python 2",
"language": "python2"
}
Run Code Online (Sandbox Code Playgroud)
现在我也想使用IPython.parallel,但是当我启动一个集群时它将自动启动Python 3中的引擎,我该如何将其更改为Python 2?
我解决了这个问题
sudo mkdir /etc/ipython/
sudo nano /etc/ipython/ipython_config.py
添加这些行:
c = get_config()
c.LocalControllerLauncher.controller_cmd = ['/usr/bin/python2', '-m', 'IPython.parallel.controller']
c.LocalEngineLauncher.engine_cmd = ['/usr/bin/python2', '-m', 'IPython.parallel.engine']
c.LocalEngineSetLauncher.engine_cmd = ['/usr/bin/python2', '-m', 'IPython.parallel.engine']
Run Code Online (Sandbox Code Playgroud)
现在引擎应该从 python2 开始
Jupyter 1.0 或 IPython 4.0 的编辑: 更改为
c = get_config()
c.LocalControllerLauncher.controller_cmd = ['/usr/bin/python2', '-m', 'ipyparallel.controller']
c.LocalEngineLauncher.engine_cmd = ['/usr/bin/python2', '-m', 'ipyparallel.engine']
c.LocalEngineSetLauncher.engine_cmd = ['/usr/bin/python2', '-m', 'ipyparallel.engine']
Run Code Online (Sandbox Code Playgroud)
并恢复集群选项卡: sudo mkdir /etc/jupyter/
sudo nano /etc/jupyter/jupyter_notebook_config.py
Run Code Online (Sandbox Code Playgroud)
添加这个:
c.NotebookApp.server_extensions.append('ipyparallel.nbextension')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2313 次 |
| 最近记录: |