Python hmmlearn installation issues

I’ve recently started learning how to apply a Hidden Markov Model (HMM) to some states of honeybee behaviour in my data and have been trying to install Python’s hmmlearn library. Unfortunately I kept getting this frustrating error due to it being unable to locate NumPy headers:

 hmmlearn error: 'numpy/arrayobject.h' file not found 

After a bit of searching I found the solution in a ticket on GitHub, but I thought I’d include it here a) for my own future reference and b) I’ve updated the command to be applicable for Python 3.5.

 export CFLAGS="-I /usr/local/lib/python3.5/site-packages/numpy/core/include/ $CFLAGS" 

Once you’ve run this then you should should be able to install hmmlearn via pip without any problem.

The following two tabs change content below.
Computational biology PhD candidate at the Australian National University. I love writing (both articles and software), learning more about the world around us, and beekeeping. I also write for BioSky.co

Latest posts by Jack Simpson (see all)

Comments are closed.