# Python debug against Slicer \`HEAD\`

**URL:** <https://discourse.slicer.org/t/python-debug-against-slicer-head/32670>\
**Category:** Development\
**Tags:** debug\
**Created:** [November 8, 2023, 1:27pm UTC](https://discourse.slicer.org/t/python-debug-against-slicer-head/32670 "2023-11-08T13:27:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhlegarreta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jhlegarreta/32/66542_2.png) [@jhlegarreta](https://discourse.slicer.org/u/jhlegarreta)\
**Post date:** [November 8, 2023, 1:27pm UTC](https://discourse.slicer.org/t/python-debug-against-slicer-head/32670/1 "2023-11-08T13:27:08Z")

</div>

Hi,  
I have visited the 3D Slicer documentation Python debugging documentation:  
[Python debugging — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/debugging/python.html)

And have visited the `SlicerDebuggingTools` `README`:  
[GitHub - SlicerRt/SlicerDebuggingTools: Extension for 3D Slicer containing various tools for module development and debugging](https://github.com/SlicerRt/SlicerDebuggingTools)

I am wondering whether there is the possibility to debug a given Python code (e.g. a Python test script in an extension) against the 3D Slicer `HEAD` that we may have checked out and compiled.

Otherwise, using an installed version of Slicer does not strictly guarantee that any fix to a given extension will work with the 3D Slicer `HEAD`.

Thanks.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 9, 2023, 3:06am UTC](https://discourse.slicer.org/t/python-debug-against-slicer-head/32670/2 "2023-11-09T03:06:30Z")

</div>

> [@jhlegarreta](#):
>
> I am wondering whether there is the possibility to debug a given Python code (e.g. a Python test script in an extension) against the 3D Slicer `HEAD` that we may have checked out and compiled.

Yes, this is the preferred method of testing extensions, as this method works for both Python and C++ modules. (it may be hard to ensure ABI compatibility of C++ code built on different computers)

> [@jhlegarreta](#):
>
> Otherwise, using an installed version of Slicer does not strictly guarantee that any fix to a given extension will work with the 3D Slicer `HEAD`.

If you reproduce a problem on your computer and then fix it on your computer then it is practically guaranteed that the problem will be fixed on the factory computer, too.

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jhlegarreta/32/66542_2.png) [@jhlegarreta](https://discourse.slicer.org/u/jhlegarreta)\
**Post date:** [November 14, 2023, 9:35pm UTC](https://discourse.slicer.org/t/python-debug-against-slicer-head/32670/3 "2023-11-14T21:35:04Z")

</div>

> [@lassoan](#):
>
> Yes, this is the preferred method of testing extensions, as this method works for both Python and C++ modules. (it may be hard to ensure ABI compatibility of C++ code built on different computers)

OK. Thanks. Not sure why, but from the documentation I had the impression that I had to use a release version, but I guess I missed parts of it.

Will give it a try when I’ll have the time.
