Using both Python 2.x and Python 3.x in IPython Notebook

问题:

I use IPython notebooks and would like to be able to select to create a 2.x or 3.x python notebook in IPython.我使用 IPython 笔记本,并希望能够选择在 IPython 中创建 2.x 或 3.x python 笔记本。

I initially had Anaconda.我最初有 Anaconda。 With Anaconda a global environment variable had to be changed to select what version of python you want and then IPython could be started.使用 Anaconda 时,必须更改全局环境变量以选择所需的 Python 版本,然后才能启动 IPython。 This is not what I was looking for so I uninstalled Anaconda and now have set up my own installation using MacPorts and PiP.这不是我想要的,所以我卸载了 Anaconda,现在使用 MacPorts 和 PiP 设置了我自己的安装。 It seems that I still have to use看来还是得用

port select --set python <python version> 

to toggle between python 2.x and 3.x.在 python 2.x 和 3.x 之间切换。 which is no better than the anaconda solution.这并不比 anaconda 解决方案好。

Is there a way to select what version of python you want to use after you start an IPython notebook, preferably with my current MacPorts build?有没有办法在启动 IPython 笔记本后选择要使用的 Python 版本,最好使用我当前的 MacPorts 版本?


解决方案:

参考一: https://en.stackoom.com/question/23wWV
参考二: https://stackoom.com/question/23wWV
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章