Monday, February 2, 2015

Installing IPython Notebook on Redhat

I wanted in install IPython Notebook and got tripped up on sqlite dependencies.  Here is what worked:

# Install support libraries for python 2.7
yum groupinstall -y 'development tools'
yum install -y zlib-devel bzip2-devel openssl-devel xz-libs wget sqlite-devel

# Prepare, build and install python 2.7 as an alternate (don't mess with system python 2.6)
cd /usr/src
tar xzf Python-2.7.8.tgz
cd Python-2.7.8
make altinstall

# Make sure Python 2.7 exec is available
export PATH="/usr/local/bin:$PATH"

# Check Python 2.7 and sqlite before moving forward
python2.7 -c 'import sqlite3'  # should have no output, especially errors

# Install setup tools (needed to install pip)
cd ..
wget --no-check-certificate
tar -xvf setuptools-1.4.2.tar.gz
cd setuptools-1.4.2

# Install setup toos into python 2.7
python2.7 install

# Install pip
cd ..
curl | python2.7 -
pip --version

# Use pip to install ipython notebook
pip install "ipython[notebook]"

# start it up (in background—maybe should use screen)
# Note use of ip parm to avoid issue with not runnin IPV6, per:

# cd to the directory that you want to serve your notebooks from and…
ipython notebook --ip

# the --ip was to avoid a problem with not running IPv6 (you may be able to leave that off)

# Then open http://localhost:8888/ and you should be up and running

Most of the python is derivative of this page:

But in my case, that one comment by Teodor-Bogdan Barbieru was key... including sqlite-devel in the prerequisites.  The above probably works on Centos too.