Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4267768
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:56:40+00:00 2026-05-21T06:56:40+00:00

Hi I am new to Python and am following the Python Image Tutorial .

  • 0

Hi I am new to Python and am following the Python Image Tutorial.

The following executes with no errors after installing the packages described in the tutorial

import numpy
import scipy
import pylab
import pymorph
import mahotas
from scipy import ndimage

However when I try reading an image

image = mahotas.imread('picture_file.jpg')

I get

image = mahotas.imread(‘image_file.jpg’)
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python2.6/dist-packages/mahotas-0.6.4-py2.6-linux-i686.egg/mahotas/init.py”, line 68, in imread
raise ImportError(‘mahotas.imread dependends on freeimage. Could not find it. Error was: %s’ % e)
ImportError: mahotas.imread dependends on freeimage. Could not find it. Error was: mahotas.freeimage: could not find libFreeImage in any of the following directories:
‘/usr/local/lib/python2.6/dist-packages/mahotas-0.6.4-py2.6-linux-i686.egg/mahotas’, ‘/lib’, ‘/usr/lib’, ‘/usr/local/lib’, ‘/opt/local/lib’

I tried installing FreeImagePy and can import it with no problems but it does not help. I have tried adding to the Python path using package sys but not help either.

EDIT: I should have mentioned that all the packages except pymorph and mahotas was installed
on my linux box doing ‘*sudo apt-get install package_name*’ while pymorph and mahotas was installed by downloading and doing ‘sudo python setup.py install‘.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T06:56:41+00:00Added an answer on May 21, 2026 at 6:56 am

    Answer for more recent versions of mahotas

    Mahotas itself does not have the functionality to read in images. imread is just a wrapper around one of 3 backends:

    1. mahotas-imread (i.e., https://pypi.python.org/pypi/imread)
    2. FreeImage
    3. matplotlib (which only supports PNG & JPEG)

    Thus, you need to install one of the packages above. Freeimage can be installed on Ubuntu as described below.

    If you are running on Windows, you may wish to try Christoph Gohlke’s packages.

    Original answer (for older versions of mahotas)

    You need to install freeimage to be able to use mahotas.imread (everything else will actually work without it, it’s an optional dependency). This is not a Python package per se, just a regular library.

    I don’t know what distribution you are in, but try looking for a freeimage package. On debian/ubuntu, you can just do:

    sudo apt-get install libfreeimage3
    

    You will have a file libfreeimage.so in /usr/lib or in a similar place and everything will work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new to Python, sort of following Dive into Python 2 and wanted
I'm new to python and django, and when following the Django Book I learned
i am new to python and learning it for my job functions. im following
I'm relatively new to python and scipy, being a convert from MATLAB. I was
I am new to python and struggling to find how to control the amount
I'm relatively new to Python and am having problems programming with Scapy, the Python
I am extremely new to python, having started to learn it less than a
I am new to Python, and I'm working on writing some database code using
I am really new to Python and I have been looking for an example
I'm new to python, and have a list of longs which I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.