# How to execute a python code from spyder in the python console that is inside Slicer?

**URL:** https://discourse.slicer.org/t/how-to-execute-a-python-code-from-spyder-in-the-python-console-that-is-inside-slicer/30911
**Category:** Development
**Tags:** python
**Created:** [August 1, 2023, 3:27pm UTC](https://discourse.slicer.org/t/how-to-execute-a-python-code-from-spyder-in-the-python-console-that-is-inside-slicer/30911 "2023-08-01T15:27:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![HBM](https://avatars.discourse-cdn.com/v4/letter/h/cc9497/32.png) [@HBM](https://discourse.slicer.org/u/HBM)
#### Post date: [August 1, 2023, 3:27pm UTC](https://discourse.slicer.org/t/how-to-execute-a-python-code-from-spyder-in-the-python-console-that-is-inside-slicer/30911/1 "2023-08-01T15:27:45Z")

</div>

I have written my own image registration code in Spyder and want to run it in 3D slicer to see if my code works. How do I do this?

---

<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: [August 2, 2023, 4:26am UTC](https://discourse.slicer.org/t/how-to-execute-a-python-code-from-spyder-in-the-python-console-that-is-inside-slicer/30911/2 "2023-08-02T04:26:48Z")

</div>

Spyder does not know how to instantiate all the application classes that you may need to use in your Slicer scripts. Instead, you can start the Slicer application, which can execute your script. You can to Slicer’s Python environment using remote Python debugging from VS Code, PyCharm, etc. as described here:

> **[GitHub - SlicerRt/SlicerDebuggingTools: Extension for 3D Slicer containing...](https://github.com/SlicerRt/SlicerDebuggingTools#python-debugger)**
>
> Extension for 3D Slicer containing various tools for module development and debugging - GitHub - SlicerRt/SlicerDebuggingTools: Extension for 3D Slicer containing various tools for module developme...
