How To Get IPython Notebook To Run Python 3?

前端 未结 9 631
被撕碎了的回忆
被撕碎了的回忆 2021-01-30 02:03

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
相关标签:
9条回答
  • 2021-01-30 02:36

    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.

    0 讨论(0)
  • 2021-01-30 02:37

    If you have both version available on jupyter notebook, you can change the kernel from menu.

    0 讨论(0)
  • 2021-01-30 02:42

    If you are running anaconda, then the preferred way to install notebook/jupyter is using conda:

    conda install jupyter
    
    0 讨论(0)
  • 2021-01-30 02:42

    Another solution would be to create a virtualenv with python3:

    From this environment, install tensorflow (the version you prefer) there:

    pip install tensorflow
    

    Run your jupyter from there !

    0 讨论(0)
  • 2021-01-30 02:43

    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.

    0 讨论(0)
  • 2021-01-30 02:43

    Switch the role of 2 and 3 in this answer as appropriate.

    Say you already have jupyter setup with a python 2 kernel and an anaconda environment with python 3. Activate the python 3 enviroment and then run

    conda install ipykernel
    

    After that you can select both a 2 and 3 kernel when creating a new notebook, or in a running notebook from the kernels menu.

    0 讨论(0)
提交回复
热议问题