Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to use the module skimage, which calls the module SciPy (I need to find contours)

import numpy
from sys import argv
from PIL import Image
from skimage import measure

# Inicialization
spritesToFind = argv[1]
spriteSize = argv[2]
sheet = Image.open(argv[3])

# To grayscale, so contour finding is awesome
grayscale = sheet.convert('L')

# Let numpy do the heavy lifting for converting pixels to pure black or white
data = np.asarray(grayscale).copy()

# Find the contours we need
contours = measure.find_contours(r_grey, 0.8)

# Now we put it back in PIL land
sprite = Image.fromarray(data)
sprite.save(str(Counter), "PNG")

I set upon an epic 5 hour journey to figure out to how solve the problem which is:

Traceback (most recent call last):
 File "algo.py", line 4, in <module>
from skimage import measure
 File "/usr/local/lib/python2.7/dist-packages/scikit_image-0.9.3-py2.7-linux-i686.egg/skimage/measure/__init__.py", line 3, in <module>
from ._regionprops import regionprops, perimeter
 File "/usr/local/lib/python2.7/dist-packages/scikit_image-0.9.3-py2.7-linux-i686.egg/skimage/measure/_regionprops.py", line 5, in <module>
from scipy import ndimage
ImportError: No module named scipy

So I figured I had to install SciPy. I began with pip and easy_install, couldn't get the thing to work. I downloaded both numpy and scipy tarballs and configured them, but scipy required libraries, which I had, just newer versions, but it didnt want them, even though I pointed them at it. Next thing I needed was gfortran, which I couldn't install because none of the libraries would work( there is a link of gfortran on linuxmint.community but you can't reach it because atpurl sais the package is virtual ). I tryed everything. Can you give me some help? All I want is SciPy to work.


Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
share|improve this question
What distro are you using? Also what version of Python is this? – slm Nov 30 '13 at 15:36
Linux mint 15 - Python 2.7 – throwaway123456783 Nov 30 '13 at 15:36
Try installing the module via your distros package manager rather than try and install it using pip/easy_install. – slm Nov 30 '13 at 15:50
As you clearly are unused to the pip and easy-install commands for installing python modules (there are no such things as pips/easy-installs), I recommend you follow slm's advice. Getting the different versions of python modules and the non-python libraries they build upon in sync for complex applications can be difficult. Even for someone well versed in using these commands including installing module versioning. It is also possible to break your installation if you replace a needed python module with a broken update unless you use virtualenv. – Anthon Nov 30 '13 at 15:58
up vote 2 down vote accepted

Rather than try to install this module yourself I'd recommend just using it from your distributions repository. I found this module available, so this command should install it for you.

$ sudo apt-get install python-scipy

If you're going to be doing a fair amount of Python development I'd encourage you to setup your own dedicated instance of Python rather than depend on the one provided by the distribution. True you can use this version, and probably not have too many issues doing so, but when you start to have to install a lot of dependencies (libraries/modules) it can become problematic to do so.

I wrote up detailed notes on how to do this for Python in this U&L Q&A titled: Upgrading Python 2.6. libpython2.6.so.1.0 missing.

share|improve this answer
E: Unable to locate package python-scipy – throwaway123456783 Nov 30 '13 at 15:54
Try this command then: apt-cache search scipy. This package is in the official Ubuntu repositories, I know Mint derives from that distro, not sure how they mix the repositories though. – slm Nov 30 '13 at 15:55
Oh my god. There was a problem with my package list, I can't believe I didn't see it earlier...Thank you so much! Words can't express my gratitude right now! – throwaway123456783 Nov 30 '13 at 16:03
@EcoGiko - EXCELLENT! Glad this helped you out. Please mark this as accepted so that others know your issue's been resolved. – slm Nov 30 '13 at 16:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.