# Fix for \`no package called pandas\` in SlicerMorph ALPACA k-means template selection - Apple ARM

**URL:** <https://discourse.slicer.org/t/fix-for-no-package-called-pandas-in-slicermorph-alpaca-k-means-template-selection-apple-arm/36094>\
**Category:** SlicerMorph\
**Tags:** python\
**Created:** [May 11, 2024, 6:33pm UTC](https://discourse.slicer.org/t/fix-for-no-package-called-pandas-in-slicermorph-alpaca-k-means-template-selection-apple-arm/36094 "2024-05-11T18:33:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnations](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@jnations](https://discourse.slicer.org/u/jnations)\
**Post date:** [May 11, 2024, 6:33pm UTC](https://discourse.slicer.org/t/fix-for-no-package-called-pandas-in-slicermorph-alpaca-k-means-template-selection-apple-arm/36094/1 "2024-05-11T18:33:51Z")

</div>

Hi community,

I’ve run into a problem with k-means template selection on 2 different mac machines. One is a 2020 MacBook Pro M1, and the second is a 2023 MacBook Pro M3 Max. Working through the tutorial [here](https://github.com/SlicerMorph/Tutorials/blob/main/MALPACA/K-means_templates_selection.md), I can run steps 1 & 2, generating the reference point cloud, and generating the point clouds for the rest of my samples that match the reference, without error. Everything looks fine.

When I go to the next step called `K-means based template selection`, I set my number of templates, my # of iterations, then push the button and nothing happens. Changing the settings doesn’t help. A red stop sign with an error message pops up in the corner. The python console it says:

` no package called pandas found`

anaconda is built correctly on both computers, and pandas is installed. Error still received.

I found that following the steps outlined in [this discourse post from 2019](https://discourse.slicer.org/t/automatic-install-of-python-packages/7078/4) from @pieper fixes the problem.

Go to the python terminal in Slicer, then:

```auto
>>> import os
>>> os.system('PythonSlicer -m pip install pandas')
0
>>> import pandas

```

(This is @pieper 's work, not mine 🙂 )

Restart, and everything works like normal! It took me a while to figure out a fix for this. I am hoping that anyone who has this problem will run across this post.

Cheers!

---

<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:** [May 12, 2024, 2:10am UTC](https://discourse.slicer.org/t/fix-for-no-package-called-pandas-in-slicermorph-alpaca-k-means-template-selection-apple-arm/36094/2 "2024-05-12T02:10:45Z")

</div>

This is interesting, thanks for sharing.

ALPACA itself doesn’t use Pandas, but it calls GPA module, which uses. But I thought pandas is bundled with core SlicerPython. So you shouldn’t have to manually install it.

So I am not sure why this is happening. Is this a apple silicon specific issue?

---

<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:** [May 12, 2024, 11:21am UTC](https://discourse.slicer.org/t/fix-for-no-package-called-pandas-in-slicermorph-alpaca-k-means-template-selection-apple-arm/36094/3 "2024-05-12T11:21:52Z")

</div>

I don’t think pandas is bundled with Slicer core. Any module that needs it should pip install it.

---

<div class="post-metadata">

**Author:** ![jnations](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@jnations](https://discourse.slicer.org/u/jnations)\
**Post date:** [May 12, 2024, 8:11pm UTC](https://discourse.slicer.org/t/fix-for-no-package-called-pandas-in-slicermorph-alpaca-k-means-template-selection-apple-arm/36094/4 "2024-05-12T20:11:36Z")

</div>

> Is this a apple silicon specific issue?

In my experience, k-means template selection and all the other SlicerMorph tools have worked out of the box on Windows machines. I found it interesting that no one else has reported this problem. Maybe the k-means selection isn’t commonly on Macs.

I should report that I’m using 3DSlicer 5.6.2, and I installed SlicerMorph on this machine within the past 2 days. The older M1 machine that had this same issue was using the stable 3DSlicer build from January 2024.
