[Insight-users] ImportError: No module named ITKMetricsv4Python

Brett Tully brett.tully at oxyntix.com
Tue Oct 2 12:18:38 EDT 2012


I grabbed 4.2 from the website yesterday. I have just found that `import
itk` works, but I am trying to follow the python registration examples --
i.e.
https://github.com/Kitware/ITK/blob/master/Examples/Registration/ImageRegistration3.py
where
`import InsightToolkit` is used.

If I comment out the line from the error message, I am able to import it
and the example linked above runs; this is probably the solution for now if
there is nothing wrapped anyway.
>   File "/usr/local/lib/ITK-4.2/Python/InsightToolkit.py", line 77, in
<module>

Brett.

On Tue, Oct 2, 2012 at 5:07 PM, Bradley Lowekamp <blowekamp at mail.nih.gov>wrote:

> Hello Brett,
>
> What version of ITK did you compile? I have a version of 4.2 with wrapITK
> that is working just fine. I usually do an "import itk".
>
> There is nothing wrapped in the Metricsv4 directory:
>
>
> https://github.com/Kitware/ITK/tree/master/Modules/Registration/Metricsv4/wrapping
>
> So I don't think you are missing anything.
>
> Brad
>
> On Oct 2, 2012, at 11:49 AM, Brett Tully <brett.tully at oxyntix.com> wrote:
>
> > Dear all,
> >
> > I have built ITK from source, and I believe that it has succeeded (some
> the C++ examples run with no problems). However, I am trying to use ITK
> through Python and I get the following error:
> >
> > >>> import InsightToolkit as itk
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in <module>
> >   File "/usr/local/lib/ITK-4.2/Python/InsightToolkit.py", line 77, in
> <module>
> >     from ITKMetricsv4Python import *
> > ImportError: No module named ITKMetricsv4Python
> >
> > I have tried searching the web, and have compiled with various different
> options, but I can't seem to get it to work. I am sure that the related C++
> has compiled, as ./ITKMetricsv4TestDriver runs just fine...
> >
> > Am I missing something obvious?
> >
> > Thanks,
> > Brett.
> >
> >
> >
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://www.kitware.com/products/protraining.php
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > http://www.itk.org/Wiki/ITK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20121002/47e9896d/attachment.htm>


More information about the Insight-users mailing list