# Running external python file from

**URL:** <https://discourse.slicer.org/t/running-external-python-file-from/25002>\
**Category:** Support\
**Created:** [August 30, 2022, 2:35pm UTC](https://discourse.slicer.org/t/running-external-python-file-from/25002 "2022-08-30T14:35:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AMK](https://avatars.discourse-cdn.com/v4/letter/a/f0a364/32.png) [@AMK](https://discourse.slicer.org/u/AMK)\
**Post date:** [August 30, 2022, 2:35pm UTC](https://discourse.slicer.org/t/running-external-python-file-from/25002/1 "2022-08-30T14:35:47Z")

</div>

Hi,

I have developed a deep learning model for segmentation. For the purpose of inference, I want to run a python file from Slicer. What commands should I use for this purpose?

---

<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:** [August 30, 2022, 3:57pm UTC](https://discourse.slicer.org/t/running-external-python-file-from/25002/2 "2022-08-30T15:57:41Z")

</div>

You might be able to install all the needed python packages into Slicer’s python using the `slicer.util.pip_install` or if it’s an independent python installation you can use `slicer.util.launchConsoleProcess`.
