4

I did a fresh install of Fedora 23 yesterday. I installed Jupyter per the instructions at https://jupyter.readthedocs.org/en/latest/install.html 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 http://jupyter.cs.brynmawr.edu/hub/dblank/public/Jupyter%20Help.ipynb#1.4.2-Enable-Python-3-kernel.

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

thx

pneumatics
  • 2,836
  • 1
  • 27
  • 27
Max Wen
  • 737
  • 2
  • 10
  • 21
  • 1
    I added a second [answer for non-anaconda users](http://stackoverflow.com/a/34464003/2272172) to the linked question. It is very similar to my anaconda solution. It just replaces conda environments by normal virtualenvs. I myself prefer virtualenvs over installing directly into the system interpreter, but this is a tradeoff between convenience and cleanness. – cel Dec 25 '15 at 15:24
  • Thanks that is also a great resource. I do think virtualenvs are a great way to manage this issue. I myself have gotten away without using virtualenvs for a long time. But this issue has been the one to convince me I need to start using them. – Max Wen Dec 27 '15 at 02:15

1 Answers1

5

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 python-pip, python-pip3, install jupyter on one version of Python, and then install the kernel for the other 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 python-pip
dnf install python3-pip

Then, install jupyter. We'll use python3 because it's 2016 already!

pip3 install jupyter

Install the ipykernel package for python2:

python2 -m pip install ipykernel
python2 -m ipykernel install

Edit: the documentation situation has improved, you can probably just follow the instructions here.

I put these instructions in a handy script in this gist.

I also put up a script that will run Jupyter for you on a cloud machine, opening and closing port 8888 and running on a public IP.

Community
  • 1
  • 1
pneumatics
  • 2,836
  • 1
  • 27
  • 27
  • Thank you. I followed your instructions with only 1 small change for fedora python-dev => python-devel, python3-dev => python3-devel. IMO I do not think most of the documentation makes it clear that you must run BOTH 'pip install jupyter' and 'pip3 install jupyter' – Max Wen Dec 24 '15 at 05:56
  • I managed to get it working on a fresh Fedora 23 machine, though with some difficulty related to installing system dependencies. I'll update this answer with those steps, if you think it would be helpful. – pneumatics Dec 24 '15 at 06:01
  • Wow that's a great resource. Thanks for documenting that. I am not sure why it has been so difficult to get this complete information although I suspect it has to do with so many people saying "just use Anaconda". If someone is on Win/Mac I probably agree but there is absolutely no need for Anaconda on Linux (I really hope that statement does not start a flamewar : / ) – Max Wen Dec 24 '15 at 06:48
  • 1
    why not use `dnf install python-pip` ? – Darleison Rodrigues Apr 17 '16 at 21:55
  • 1
    For posterity, `dnf install python3-pip` was the command that worked for me. Specifically, I had to `reinstall` using `dnf` to get the `/usr/bin/` folders to show up for `pip3`. – roflmyeggo Apr 30 '16 at 16:54
  • 1
    @roflmyeggo thanks, I updated the instructions, and gave you a bonus script to run jupyter on a cloud machine. It worked for me on a Fedora 23 Digital Ocean droplet. hth – pneumatics Apr 30 '16 at 23:59