0

I've just cloned the NiPy repository, but when I try to import nipy.algorithms.registration, I get the following error:

In [1]: import nipy.algorithms.registration
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-17bae03bf7b5> in <module>()
----> 1 import nipy.algorithms.registration

/home/despo/dbliss/nipy/nipy/algorithms/__init__.py in <module>()
      7 __docformat__ = 'restructuredtext'
      8 
----> 9 import statistics
     10 import fwhm, interpolation, kernel_smooth, diagnostics
     11 

/home/despo/dbliss/nipy/nipy/algorithms/statistics/__init__.py in <module>()
      6 __docformat__ = 'restructuredtext'
      7 
----> 8 from . import intvol, rft, onesample, formula
      9 from ._quantile import _quantile as quantile, _median as median
     10 

ImportError: cannot import name intvol

I discovered that there are two files called intvol in the repository: intvol.c and intvol.pyx. What's going on?

SOLVED: See first comment below.

abcd
  • 10,215
  • 15
  • 51
  • 85
  • 1
    You have to compile first. `python setup.py build_ext --inplace` (or use a package manager such as `pip`). – Fred Foo Nov 26 '13 at 19:44
  • Well `pip`, right, I don't want to use, because I want to install the repo from GitHub, up through the most recent commit -- not the version of the package that `pip` has. But you're saying saving the repo locally and putting it in my PYTHONPATH isn't enough? I need to run `setup.py`? What exactly needs to be compiled that isn't able to be compiled during the import (as normally happens when I import a module, and a .pyc file is automatically created)? – abcd Nov 26 '13 at 21:10
  • That did the job for me, @larsmans, thanks! I suppose I'll have to run `setup.py` like this every time I pull. – abcd Nov 26 '13 at 22:26

0 Answers0