# Latest slicer preview (r33816) does not launch in macos

**URL:** <https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935>\
**Category:** Support\
**Created:** [August 3, 2025, 5:13am UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935 "2025-08-03T05:13:58Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [August 3, 2025, 5:13am UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/1 "2025-08-03T05:13:58Z")

</div>

Tested on two different macs (imac and macbook pro) with Sequoia 15.5. After entering the security exception, Slicer icon continues to bounce for about a minute and then quits. When launched from the terminal window from Slicer.app/Contents/MacOS/Slicer, this is the error message:

```auto
% pwd
/Users/murat

% /Users/murat/Desktop/Slicer.app/Contents/MacOS/Slicer
Could not find platform independent libraries 
Could not find platform dependent libraries <exec_prefix>
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = ‘Slicer’
isolated = 0
environment = 1
user site = 0
safe_path = 0
import site = 1
is in build tree = 0
stdlib dir = ‘/Users/svc-dashboard/D/P/A/python-install/lib/python3.12’
sys.\_base_executable = ‘/Users/murat/Desktop/Slicer.app/Contents/MacOS/Slicer’
sys.base_prefix = ‘/Users/svc-dashboard/D/P/A/python-install’
sys.base_exec_prefix = ‘/Users/svc-dashboard/D/P/A/python-install’
sys.platlibdir = ‘lib’
sys.executable = ‘/Users/murat/Desktop/Slicer.app/Contents/MacOS/Slicer’
sys.prefix = ‘/Users/svc-dashboard/D/P/A/python-install’
sys.exec_prefix = ‘/Users/svc-dashboard/D/P/A/python-install’
sys.path = \[
‘/Users/svc-dashboard/D/P/A/python-install/lib/python312.zip’,
‘/Users/svc-dashboard/D/P/A/python-install’,
‘/Users/svc-dashboard/D/P/A/python-install/lib-dynload’,
‘/Users/svc-dashboard/D/P/A/python-install/plat-darwin’,
‘/Users/svc-dashboard/D/P/A/python-install/lib/python3.12’,
‘/Users/svc-dashboard/D/P/A/python-install/lib/python3.12/lib-dynload’,
‘/Users/svc-dashboard/D/P/A/python-install/lib-tk’,
‘/Users/svc-dashboard/D/P/A/python-install/lib/python3.12’,
‘/Users/svc-dashboard/D/P/A/python-install/lib/python3.12/lib-dynload’,
\]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named ‘encodings’

Current thread 0x0000000200aaf200 (most recent call first):

```

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [August 3, 2025, 11:21am UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/2 "2025-08-03T11:21:54Z")

</div>

The same `ModuleNotFoundError: No module named 'encodings'` happens with Slicer 5.8.1 as you reported over in the other thread?

> [@Designer failing to launch on MacOS](https://discourse.slicer.org/t/designer-failing-to-launch-on-macos/43847/2):
>
> Some error pops up with 5.8.1 as well.

---

<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 3, 2025, 12:34pm UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/3 "2025-08-03T12:34:12Z")

</div>

I can replicate the same failure to launch (same error message) with Slicer Preview 2025-08-01 on a macbook air m3. 5.8.1 starts fine, as does the SlicerDesigner app from the Preview.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [August 3, 2025, 4:09pm UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/4 "2025-08-03T16:09:33Z")

</div>

> [@jamesobutler](#):
>
> `ModuleNotFoundError`

I think those are separate and i believe that error arose because i didnt launch the correct SlicerDesigner, but the Designer application, which didnt set the correct python environment as you mentioned in that thread.

This is the proper Slicer launcher that generates the error.

---

<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 3, 2025, 4:12pm UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/5 "2025-08-03T16:12:17Z")

</div>

On mac there’s no launcher in the distribution, so this is something with the app packaging or startup process itself.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [August 3, 2025, 4:39pm UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/6 "2025-08-03T16:39:47Z")

</div>

Does a Slicer preview build from May have the same problem specifically on macOS 15.5? Just wondering if related to changes in macOS security impacting the unsigned Slicer preview builds (Slicer 5.8.1 is a signed version) is a cause here or something in recent Slicer commits.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [August 3, 2025, 6:37pm UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/7 "2025-08-03T18:37:45Z")

</div>

No this is new. I have been using preview through out july on the same computer

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [August 4, 2025, 4:47am UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/8 "2025-08-04T04:47:55Z")

</div>

So is this a minor issue that can be fixed fairly quickly or should I open an issue on GH? As of right now, today’s build also not usable.

@jcfr @lassoan

---

<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 4, 2025, 5:03am UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/9 "2025-08-04T05:03:39Z")

</div>

Failure to launch is a serious issue, so submitting an issue on github makes sense; and then this discussion should continue there. Peobably @jcfr knows most about potential root causes and fixes, but maybe you can help the investigation if you determine which is the first date where the Slicer Preview Release started to fail (you can use the offset option on thr download page to get previous releases, for example [Download 3D Slicer | 3D Slicer](http://download.slicer.org/?offset=-7)).

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [August 4, 2025, 5:26am UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/10 "2025-08-04T05:26:39Z")

</div>

Will do but there is something weird with the offset parameters. This is what I get when i put in **?offset=-3**

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/2/d2e3c6b5259ab9d9ff257c1188839c3b88e66fd0.png)

Not sure why it is showing random stable versions, which are clearly dated wrong. Also when I click the 5.9.0 from July 30, the downloaded package shows as **Slicer-5.9.0-2025-07-25-macosx-amd64.dmg**

because it doesn’t launch, I can’t confirm whether it is indeed the revision 33809 or a different revision number.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [August 4, 2025, 5:47am UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/11 "2025-08-04T05:47:32Z")

</div>

> <https://github.com/Slicer/Slicer/issues/8618>
>
> \## Summary
> As I reported on the forum https://discourse.slicer.org/t/latest-slic…er-preview-r33816-does-not-launch-in-macos/43935/10
> When the preview dmg package is opened and launched (and after entering the security exception), the icon bounces for a while and then abruptly gets killed. When launched from the terminal window, this is the output:
> 
> \`\`\`
> MLSSC40183:~ amaga$ /Users/amaga/Desktop/Slicer.app/Contents/MacOS/Slicer
> Could not find platform independent libraries \<prefix\>
> Could not find platform dependent libraries \<exec\_prefix\>
> Python path configuration:
> PYTHONHOME = (not set)
> PYTHONPATH = (not set)
> program name = 'python3'
> isolated = 0
> environment = 1
> user site = 0
> safe\_path = 0
> import site = 1
> is in build tree = 0
> stdlib dir = '/Users/svc-dashboard/D/P/A/python-install/lib/python3.12'
> sys.\_base\_executable = '/Users/amaga/Desktop/Slicer.app/Contents/MacOS/Slicer'
> sys.base\_prefix = '/Users/svc-dashboard/D/P/A/python-install'
> sys.base\_exec\_prefix = '/Users/svc-dashboard/D/P/A/python-install'
> sys.platlibdir = 'lib'
> sys.executable = '/Users/amaga/Desktop/Slicer.app/Contents/MacOS/Slicer'
> sys.prefix = '/Users/svc-dashboard/D/P/A/python-install'
> sys.exec\_prefix = '/Users/svc-dashboard/D/P/A/python-install'
> sys.path = \[
> '/Users/svc-dashboard/D/P/A/python-install/lib/python312.zip',
> '/Users/svc-dashboard/D/P/A/python-install',
> '/Users/svc-dashboard/D/P/A/python-install/lib-dynload',
> '/Users/svc-dashboard/D/P/A/python-install/plat-darwin',
> '/Users/svc-dashboard/D/P/A/python-install/lib/python3.12',
> '/Users/svc-dashboard/D/P/A/python-install/lib/python3.12/lib-dynload',
> '/Users/svc-dashboard/D/P/A/python-install/lib-tk',
> '/Users/svc-dashboard/D/P/A/python-install/lib/python3.12',
> '/Users/svc-dashboard/D/P/A/python-install/lib/python3.12/lib-dynload',
> \]
> Fatal Python error: init\_fs\_encoding: failed to get the Python codec of the filesystem encoding
> Python runtime state: core initialized
> ModuleNotFoundError: No module named 'encodings'
> \`\`\`
> The last known version that works for me is 5.9.0-2025-07-12 r33764 / d6c7975
> For me all packages downloaded after that date, shows the same error. 
> 
> @jcfr

The last version that I can download and get it to work on my mac is:

5.9.0-2025-07-12 r33764 / [d6c7975](https://github.com/Slicer/Slicer/commit/d6c79751ed3e79693d76550d6ce5fb245258a878)

---

<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:** [August 6, 2025, 2:43pm UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/12 "2025-08-06T14:43:45Z")

</div>

To follow-up on this, the root cause has been identified.

Waiting it is addressed, consider running Slicer using the following helper script: [slicer-macos-launch.sh](https://gist.github.com/jcfr/4eca5ab7d5d0da9706ad4099a07c6949)

* * *

Download the script:

```bash
curl -LO https://gist.githubusercontent.com/jcfr/4eca5ab7d5d0da9706ad4099a07c6949/raw/slicer-macos-launch.sh
chmod u+x slicer-macos-launch.sh

```

Run Slicer:

```bash
slicer-macos-launch.sh /path/to/Slicer.app

```

---

<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:** [August 8, 2025, 6:04pm UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/13 "2025-08-08T18:04:24Z")

</div>

Et voila. Corresponding fix has just been integrated 🚀

Thanks @pieper for the review 🙏

And if you curious about the details …

* * *

[PR-8632](https://github.com/Slicer/Slicer/pull/8632) introduces `initializeEnvironmentFromLauncher()` and ensures it runs before argument parsing and Python interpreter initialization. The method reads launcher `.ini` settings, discovers Slicer home, and sets environment variables required by early subsystems (e.g Python).

In the context of macOS installer where no launcher is used (only launcher settings file is provided along side the “real” executable), the previous init order could start Python with a partial environment, causing early import failures.

Follow-up to [Slicer@fa915a03fc](https://github.com/Slicer/Slicer/commit/fa915a03fc472618fdaa65a3815ebfdec2f92429) (“BUG: Fix improper Python initialization causing inconsistent interpreter state”) introduced through [PR-8582](https://github.com/Slicer/Slicer/pull/8582).

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [August 9, 2025, 8:28pm UTC](https://discourse.slicer.org/t/latest-slicer-preview-r33816-does-not-launch-in-macos/43935/14 "2025-08-09T20:28:47Z")

</div>

Confirmed it is working. Thanks everyone who helped fix it.
