Installation notes

There are common small issues that come up during my work that could be useful to note down


Generally python libraries can be easily installed in a virtualenv using pip but certain libraries have been problematic. This post just provides a list of packages that I've had problems with and the workarounds

1) Matplotlib

Matplotlib in virtualenv - Ubuntu 12.04 
  • Installing matplotlib requires python-tkinter to be installed for the standard backend to be used. No pip version of tkinter available
  • Install matplotlib before pyside
Matplotlib in virtualenv - Ubuntu 14.04

Error: No window showing
Issue: The default tk backend requires the tk libraries to be present
  • Install: python-tk, tk, tk8.6-dev
  • pip install matplotlib

2) Mayavi

Mayavi in a virtualenv - Ubuntu 14.04

Installing Mayavi in a virtualenv doesn't seem to be able to find the python vtk libraries
# Install python-vtk library
sudo apt-get install python-vtk
# Copy library to virtualenv
cp -r /usr/lib/pymodules/python2.7/vtk /PATH/TO/YOUR/VIRTUALENV/lib/python2.7/site-packages
# Sorted
pip install mayavi

Mayavi should work fine now in the virtualenv. This great workaround was reported by hennadii-maden at Stackoverflow

3) numba

numba - Ubuntu 14.04
(llvmlite 0.5.0, numba 0.19.2, llvm 3.5)
sudo apt-get install zlib1g zlib1g-dev libedit2 libedit-dev llvm-3.5 llvm-3.5-dev llvm-dev
pip install enum34 funcsigs
LLVM_CONFIG=/usr/bin/llvm-config-3.5 pip install llvmlite==0.5.0
LLVM_CONFIG=/usr/bin/llvm-config-3.5 pip install numba==0.19.2
from Stackoverflow

numba - OSx Yosemite
(llvmlite 0.5.0, numba 0.19.2, llvm 3.5)
brew install homebrew/versions/llvm35
pip install enum34 funcsigs
LLVM_CONFIG=/usr/local/lib/llvm-3.5/bin/llvm-config pip install llvmlite==0.5.0
LLVM_CONFIG=/usr/local/lib/llvm-3.5/bin/llvm-config pip install numba==0.19.2