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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章