# Extension Wizard Cannot Load module on Mac

**URL:** <https://discourse.slicer.org/t/extension-wizard-cannot-load-module-on-mac/39471>\
**Category:** Development\
**Created:** [October 1, 2024, 12:50pm UTC](https://discourse.slicer.org/t/extension-wizard-cannot-load-module-on-mac/39471 "2024-10-01T12:50:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexjin](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@alexjin](https://discourse.slicer.org/u/alexjin)\
**Post date:** [October 1, 2024, 12:50pm UTC](https://discourse.slicer.org/t/extension-wizard-cannot-load-module-on-mac/39471/1 "2024-10-01T12:50:02Z")

</div>

Hi, I encountered a problem where if these lines are included in the code, the module cannot be loaded through extension wizard:

```auto
            # Check if binary labelmap is valid
            if binary_labelmap.GetNumberOfPoints() > 0:
                # Count the non-zero voxels in the binary labelmap
                volume_pixels = 0
                data = vtk.util.numpy_support.vtk_to_numpy(binary_labelmap.GetPointData().GetScalars())
                volume_pixels = (data > 0).sum()

                # Assuming you know the spacing of the labelmap to convert to volume in cm³
                spacing = binary_labelmap.GetSpacing()
                volume_cm3 = volume_pixels * spacing[0] * spacing[1] * spacing[2] / 1000.0 # Convert mm³ to cm³

                # Get the segment name
                segment_name = segmentation.GetSegment(segment_id).GetName()
                segment_volumes[segment_id] = (segment_name, volume_cm3)
                total_volume += volume_cm3

                print(f"{segment_name} volume = {volume_cm3:.3f} cm³, {volume_cm3}")

```

After I press select extension and select the correct folder, the extension editor shows the files in the directory, but I don’t get a popup for adding modules.

I have tested with ARM and Intel Macs and both had the same issues, however it worked fine on windows devices.

The only way I found to add the module is by deleting these lines, and the problem persists if they are only commented out.

Thanks in advance for any help!

---

<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:** [October 1, 2024, 12:52pm UTC](https://discourse.slicer.org/t/extension-wizard-cannot-load-module-on-mac/39471/2 "2024-10-01T12:52:13Z")

</div>

> [@alexjin](#):
>
> `# Convert mm³ to cm³`

Hard to say for sure, but I’d get rid of these superscripts and use a convention like `mm^3` (i.e. all ascii).

---

<div class="post-metadata">

**Author:** ![alexjin](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@alexjin](https://discourse.slicer.org/u/alexjin)\
**Post date:** [October 1, 2024, 1:03pm UTC](https://discourse.slicer.org/t/extension-wizard-cannot-load-module-on-mac/39471/3 "2024-10-01T13:03:55Z")

</div>

Unfortunately the problem is still there after I deleted all non-ASCII characters ☹

---

<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:** [October 1, 2024, 1:13pm UTC](https://discourse.slicer.org/t/extension-wizard-cannot-load-module-on-mac/39471/4 "2024-10-01T13:13:56Z")

</div>

Maybe characters in the file path?

---

<div class="post-metadata">

**Author:** ![alexjin](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@alexjin](https://discourse.slicer.org/u/alexjin)\
**Post date:** [October 1, 2024, 1:17pm UTC](https://discourse.slicer.org/t/extension-wizard-cannot-load-module-on-mac/39471/5 "2024-10-01T13:17:16Z")

</div>

That fixed it, thanks!
