How To Get IPython Notebook To Run Python 3?

83,043

Solution 1

To set IPython Notebook to run Python 3 instead of 2 on my MAC 10.9, I did the following steps

$ sudo pip3 install ipython[all]

Then

$ ipython3 notebook

Solution 2

For linux 16.04 Ubuntu you can use

sudo apt-get install ipython3

and then use

ipython3 notebook

to open the notebook in the browser. If you have any notebooks saved with python 2 then it will automatically convert them to Python 3 once you open the notebook.

Solution 3

To use jupyter with python 3 instead of python 2 on my Windows 10 with Anaconda, I did the following steps on anaconda prompt:

pip3 install ipython[all]

Then,

ipython3 notebook

Solution 4

Is there a package from your distro? If you're using ubuntu you must to install the ipython3-notebook package. If not, maybe you must to install ipython with python3.

If you've run (because it's python2 by default)

python setup.py

you must to run instead

python3 setup.py install

to install a package with python3 instead python2. This will be a new instalation of ipython3.

Solution 5

In Anaconda "launcher.app" there is “Environment:” pull down menu. The default environment is called "root". In order to launch application using another environment, just select the desired environment from the list, to make it active.

Share:
83,043

Related videos on Youtube

Anton
Author by

Anton

Updated on July 08, 2022

Comments

  • Anton
    Anton almost 2 years

    I am new to Python to bear with me.

    1. I installed Anaconda, works great.
    2. I setup a Python 3 environment following the Anaconda cmd line instructions, works great.
    3. I setup Anaconda's Python 3 environment as Pycharm's interpreter, works great.
    4. I launched the Anaconda "launcher.app" and launched IPython Notebook. However, iPython Notebook is running Python 2 not 3.

    Over three hours of Googling later, I cannot figure out how to set IPython Notebook to run Python 3 instead of 2.

    • Thomas K
      Thomas K over 10 years
      You need to launch it from your Python 3 environment. That's easy at a command line (/path/to/env/bin/ipython), but I don't know how to do it from the Anaconda GUI launcher.
    • Anton
      Anton over 10 years
      Awesome. Thanks. For future searchers, here was the solution: export PATH=/Users/[insertusername]/anaconda/envs/py3k/bin:$PATH ipython notebook
    • Thomas K
      Thomas K over 10 years
      SO should let you answer your own question after a while, so it's clear from search results that it was resolved.
  • s g
    s g almost 7 years
    You shouldn't ever have to use sudo with pip (or pip3)
  • Stu Cox
    Stu Cox over 6 years
    Why [all] on the end? pip3 install ipython worked for me.