Max Wen Max Wen - 1 year ago 255
Python Question

Run Python 2 & 3 in Jupyter on Fedora Linux

I did a fresh install of Fedora 23 yesterday. I installed Jupyter per the instructions at which means I did this

pip install jupyter

It seems to run fun for Python 2. I tried to add support for the Python 3 kernel as per the instructions here Using both Python 2.x and Python 3.x in IPython Notebook which means I followed these instructions

I restarted the server, opened a new Python 3 notebook, and watched the kernel die 3 seconds later.

It pretty obvious to me there is very little documentation for running 2 & 3 in Jupyter on Linux without using Anaconda. Can we please make this a Fedora Linux-centric, no Anaconda thread?

Fedora 23, Python 2.7.10 / 3.4.3


Answer Source

I answered a similar question yesterday, though for Debian. The following worked on a fresh Fedora 23 machine at Digital Ocean. You'll need to install pip, pip3, install jupyter with each version of pip, and then install the kernel from each version of Python. First, make sure you have these dependencies installed:

dnf groupinstall 'Development Tools'
dnf install gcc-c++
dnf install rpm-build
dnf install python-devel
dnf install python3-devel

Then install pip and pip3:

dnf install pip
dnf install pip3

Then, use those to install jupyter:

pip install jupyter
pip3 install jupyter

Run ipython kernelspec for each version of jupyter to install the kernels:

ipython kernelspec install-self
ipython3 kernelspec install-self