# \`sys.executable\` is different when running from Slicer and from PythonSlicer

**URL:** <https://discourse.slicer.org/t/sys-executable-is-different-when-running-from-slicer-and-from-pythonslicer/24260>\
**Category:** Development\
**Created:** [July 10, 2022, 5:09pm UTC](https://discourse.slicer.org/t/sys-executable-is-different-when-running-from-slicer-and-from-pythonslicer/24260 "2022-07-10T17:09:10Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [July 11, 2022, 8:10pm UTC](https://discourse.slicer.org/t/sys-executable-is-different-when-running-from-slicer-and-from-pythonslicer/24260/5 "2022-07-11T20:10:41Z")

</div>

When using `PythonSlicer`, setting `PYTHONSTARTUP` works as expected.

When using `Slicer`, there are no support for `PYTHONSTARTUP` environment variable because Slicer application embeds the python library and the logic handling `PYTHONSTARTUP` (specific to the python interpreter) is not considered.

In the case of the Slicer application, you should instead considering using the [Application Startup File](https://slicer.readthedocs.io/en/latest/user_guide/settings.html#application-startup-file)

To provide a more targeted answer, could you provide more details ? What are you trying to achieve ?

---

_[View the full topic](https://discourse.slicer.org/t/sys-executable-is-different-when-running-from-slicer-and-from-pythonslicer/24260)._
