Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

I use IPython notebooks and would like to be able to select to create a 2.x or 3.x python notebook in IPython.

I initially had 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. This is not what I was looking for so I uninstalled Anaconda and now have set up my own installation using MacPorts and PiP. It seems that I still have to use

port select --set python <python version>

to toggle between python 2.x and 3.x. which is no better than the anaconda solution.

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?

1 Answer

0 votes
by (106k points)

If you are using Jupyter on Python 3, you can set up a Python 2 kernel like this:

python2 -m pip install ipykernel 

python2 -m ipykernel install --user

Related questions

0 votes
1 answer
0 votes
1 answer
asked Sep 23, 2019 in Python by Karan Singh (4.1k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...