# CannyFilter Python ITK

**URL:** <https://discourse.itk.org/t/cannyfilter-python-itk/2435>\
**Category:** Algorithms\
**Created:** [November 22, 2019, 8:58am UTC](https://discourse.itk.org/t/cannyfilter-python-itk/2435 "2019-11-22T08:58:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fraca](https://discourse.itk.org/letter_avatar_proxy/v4/letter/f/f19dbf/32.png) [@fraca](https://discourse.itk.org/u/fraca)\
**Post date:** [November 22, 2019, 8:58am UTC](https://discourse.itk.org/t/cannyfilter-python-itk/2435/1 "2019-11-22T08:58:56Z")

</div>

I’m trying to reproduce this example in python [https://itk.org/ITKExamples/src/Filtering/ImageFeature/DetectEdgesWithCannyFilter/Documentation.html](https://itk.org/ITKExamples/src/Filtering/ImageFeature/DetectEdgesWithCannyFilter/Documentation.html) but i have an error: `TypeError: <module 'ITKSmoothing'> is a built-in module`.  
Do you have any ideas how to solve it?

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [November 25, 2019, 2:02am UTC](https://discourse.itk.org/t/cannyfilter-python-itk/2435/2 "2019-11-25T02:02:39Z")

</div>

Hi @fraca,

Are you using the [Python script](https://github.com/InsightSoftwareConsortium/ITKExamples/blob/master/src/Filtering/ImageFeature/DetectEdgesWithCannyFilter/Code.py) included with the example?

> [@fraca](#):
>
> i have an error: `TypeError: <module 'ITKSmoothing'> is a built-in module` .

If you are using the script and are encountering this error, it indicates that the Python ITK installation may be invalid – the best approach in this case is to start from a new Python virtual environment or a new conda environment.

---

<div class="post-metadata">

**Author:** ![fraca](https://discourse.itk.org/letter_avatar_proxy/v4/letter/f/f19dbf/32.png) [@fraca](https://discourse.itk.org/u/fraca)\
**Post date:** [November 27, 2019, 1:59pm UTC](https://discourse.itk.org/t/cannyfilter-python-itk/2435/3 "2019-11-27T13:59:01Z")

</div>

I tried to downgrade to ITK 5.0.1 and it seems to work
