# Can 3d slicer modules be used in python code external to 3d slicer?

**URL:** <https://discourse.slicer.org/t/can-3d-slicer-modules-be-used-in-python-code-external-to-3d-slicer/11126>\
**Category:** Support\
**Created:** [April 15, 2020, 1:31pm UTC](https://discourse.slicer.org/t/can-3d-slicer-modules-be-used-in-python-code-external-to-3d-slicer/11126 "2020-04-15T13:31:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LisaDuff](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@LisaDuff](https://discourse.slicer.org/u/LisaDuff)\
**Post date:** [April 15, 2020, 1:31pm UTC](https://discourse.slicer.org/t/can-3d-slicer-modules-be-used-in-python-code-external-to-3d-slicer/11126/1 "2020-04-15T13:31:30Z")

</div>

The particular module I am interested in does have a CLI (command line interface) counterpart, am I able to use it in a separate piece of code without having to open 3d slicer?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [April 15, 2020, 2:58pm UTC](https://discourse.slicer.org/t/can-3d-slicer-modules-be-used-in-python-code-external-to-3d-slicer/11126/2 "2020-04-15T14:58:13Z")

</div>

If it’s just a CLI (as in a C++ executable) then yes, you can call it from python using the `subprocess` module. Most of the other Slicer code has dependencies that make it impossible to use in the normal interpreter, but we’ve been talking about migrating as many libraries as possible into packages that could be distributed via pypi.
