Problems installing mahotas 0.7.3 on Ubuntu 11.10

556 views
Skip to first unread message

jbest

unread,
Apr 4, 2012, 5:38:54 PM4/4/12
to pythonvision
Hello all, I'm new to this group and mahotas. I'm trying to install
mahotas using the instructions at http://luispedro.org/software/mahotas

I've tried both the easy_install approach as well as the pip and both
fail with errors. Does anyone have any tips about how to get it to
successfully install? Below are the install results.

Thanks,
Jason

PIP
------------------
sudo pip install mahotas

Downloading/unpacking mahotas
Running setup.py egg_info for package mahotas
build_src
building extension "mahotas._histogram" sources
building extension "mahotas._convex" sources
building extension "mahotas._center_of_mass" sources
building extension "mahotas._morph" sources
building extension "mahotas._thin" sources
building extension "mahotas._bbox" sources
building extension "mahotas._distance" sources
building extension "mahotas._convolve" sources
building extension "mahotas._texture" sources
building extension "mahotas._labeled" sources
building extension "mahotas._lbp" sources
building extension "mahotas._surf" sources
building extension "mahotas._zernike" sources
building extension "mahotas._interpolate" sources
build_src: building npy-pkg config files

Installing collected packages: mahotas
Running setup.py install for mahotas
unifing config_cc, config, build_clib, build_ext, build commands --
compiler options
unifing config_fc, config, build_clib, build_ext, build commands --
fcompiler options
build_src
building extension "mahotas._histogram" sources
building extension "mahotas._convex" sources
building extension "mahotas._center_of_mass" sources
building extension "mahotas._morph" sources
building extension "mahotas._thin" sources
building extension "mahotas._bbox" sources
building extension "mahotas._distance" sources
building extension "mahotas._convolve" sources
building extension "mahotas._texture" sources
building extension "mahotas._labeled" sources
building extension "mahotas._lbp" sources
building extension "mahotas._surf" sources
building extension "mahotas._zernike" sources
building extension "mahotas._interpolate" sources
build_src: building npy-pkg config files
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'mahotas._histogram' extension
compiling C++ sources
C compiler: g++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -
O2 -Wall -fPIC

compile options: '-I/usr/lib/pymodules/python2.7/numpy/core/
include -I/usr/include/python2.7 -c'
g++: mahotas/_histogram.cpp
mahotas/_histogram.cpp:24:24: fatal error: Python.h: No such file
or directory
compilation terminated.
mahotas/_histogram.cpp:24:24: fatal error: Python.h: No such file
or directory
compilation terminated.
error: Command "g++ -pthread -fno-strict-aliasing -DNDEBUG -g -
fwrapv -O2 -Wall -fPIC -I/usr/lib/pymodules/python2.7/numpy/core/
include -I/usr/include/python2.7 -c mahotas/_histogram.cpp -o build/
temp.linux-x86_64-2.7/mahotas/_histogram.o" failed with exit status 1
Complete output from command /usr/bin/python -c "import
setuptools;__file__='/home/jason/build/mahotas/
setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'),
__file__, 'exec'))" install --single-version-externally-managed --
record /tmp/pip-mCKe7g-record/install-record.txt:
running install

running build

running config_cc

unifing config_cc, config, build_clib, build_ext, build commands --
compiler options

running config_fc

unifing config_fc, config, build_clib, build_ext, build commands --
fcompiler options

running build_src

build_src

building extension "mahotas._histogram" sources

building extension "mahotas._convex" sources

building extension "mahotas._center_of_mass" sources

building extension "mahotas._morph" sources

building extension "mahotas._thin" sources

building extension "mahotas._bbox" sources

building extension "mahotas._distance" sources

building extension "mahotas._convolve" sources

building extension "mahotas._texture" sources

building extension "mahotas._labeled" sources

building extension "mahotas._lbp" sources

building extension "mahotas._surf" sources

building extension "mahotas._zernike" sources

building extension "mahotas._interpolate" sources

build_src: building npy-pkg config files

running build_py

running build_ext

customize UnixCCompiler

customize UnixCCompiler using build_ext

customize UnixCCompiler

customize UnixCCompiler using build_ext

building 'mahotas._histogram' extension

compiling C++ sources

C compiler: g++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -
Wall -fPIC



compile options: '-I/usr/lib/pymodules/python2.7/numpy/core/include -I/
usr/include/python2.7 -c'

g++: mahotas/_histogram.cpp

mahotas/_histogram.cpp:24:24: fatal error: Python.h: No such file or
directory

compilation terminated.

mahotas/_histogram.cpp:24:24: fatal error: Python.h: No such file or
directory

compilation terminated.

error: Command "g++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -
O2 -Wall -fPIC -I/usr/lib/pymodules/python2.7/numpy/core/include -I/
usr/include/python2.7 -c mahotas/_histogram.cpp -o build/temp.linux-
x86_64-2.7/mahotas/_histogram.o" failed with exit status 1

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/home/jason/
build/mahotas/setup.py';exec(compile(open(__file__).read().replace('\r
\n', '\n'), __file__, 'exec'))" install --single-version-externally-
managed --record /tmp/pip-mCKe7g-record/install-record.txt failed with
error code 1
Storing complete log in /home/jason/.pip/pip.log



easy_install
----------------------
sudo easy_install mahotas
Searching for mahotas
Reading http://pypi.python.org/simple/mahotas/
Reading http://luispedro.org/software/mahotas
Best match: mahotas 0.7.3
Downloading http://pypi.python.org/packages/source/m/mahotas/mahotas-0.7.3.tar.gz#md5=468ab16252d53abf0167b7bf9ca514d6
Processing mahotas-0.7.3.tar.gz
Running mahotas-0.7.3/setup.py -q bdist_egg --dist-dir /tmp/
easy_install-7uSRM0/mahotas-0.7.3/egg-dist-tmp-vOTzT5
mahotas/_histogram.cpp:24:24: fatal error: Python.h: No such file or
directory
compilation terminated.
mahotas/_histogram.cpp:24:24: fatal error: Python.h: No such file or
directory
compilation terminated.
error: Setup script exited with error: Command "g++ -pthread -fno-
strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -I/usr/lib/
pymodules/python2.7/numpy/core/include -I/usr/include/python2.7 -c
mahotas/_histogram.cpp -o build/temp.linux-x86_64-2.7/mahotas/
_histogram.o" failed with exit status 1
/usr/lib/pymodules/python2.7/numpy/distutils/misc_util.py:251:
RuntimeWarning: Parent module 'numpy.distutils' not found while
handling absolute import
from numpy.distutils import log

Luis Pedro Coelho

unread,
Apr 5, 2012, 5:34:38 PM4/5/12
to python...@googlegroups.com
Hi Jason,

It seems you need to install python-dev

sudo apt-get install python-dev

should do it.

HTH
Luis

--
Luis Pedro Coelho | Institute for Molecular Medicine | http://luispedro.org

signature.asc

Sprindzuk Matvey

unread,
Apr 6, 2012, 3:44:45 AM4/6/12
to python...@googlegroups.com
perhaps you should also install Scipy, PIL and python IDE, such as
Geany on Ubuntu, check Python version compatibility, Use Ubuntu
package managers for installation when possible, they help to install
dependencies

2012/4/6 Luis Pedro Coelho <lu...@luispedro.org>:

jbest

unread,
May 3, 2012, 10:39:39 PM5/3/12
to python...@googlegroups.com
Thanks for the help. It took me a while to get back to this task but with your suggestions it worked fine.

I installed python-dev, scipy, and numpy and everything working fine. Now to start playing with it...

jbest

unread,
May 3, 2012, 11:17:39 PM5/3/12
to python...@googlegroups.com
I learned of one more thing that is required for the tutorial at http://pythonvision.org/basic-tutorial

I had to install libfreeimage3
Reply all
Reply to author
Forward
0 new messages