Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing with Pip on Mac leads to ImportError #313

Closed
rsayn opened this issue Oct 11, 2023 · 6 comments · Fixed by #318
Closed

Installing with Pip on Mac leads to ImportError #313

rsayn opened this issue Oct 11, 2023 · 6 comments · Fixed by #318

Comments

@rsayn
Copy link

rsayn commented Oct 11, 2023

Hello! I tried installing GLUM with Pip, but when I try to import it I get the following error:

>>> import glum
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<path-to-working-directory>.venv/lib/python3.8/site-packages/glum/__init__.py", line 3, in <module>
    from ._distribution import (
  File "<path-to-working-directory>.venv/lib/python3.8/site-packages/glum/_distribution.py", line 8, in <module>
    from tabmat import (
  File "<path-to-working-directory>.venv/lib/python3.8/site-packages/tabmat/__init__.py", line 1, in <module>
    from .categorical_matrix import CategoricalMatrix
  File "<path-to-working-directory>.venv/lib/python3.8/site-packages/tabmat/categorical_matrix.py", line 170, in <module>
    from .ext.categorical import (
ImportError: dlopen(<path-to-working-directory>.venv/lib/python3.8/site-packages/tabmat/ext/categorical.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '___kmpc_barrier'

My machine is a Mac M1 with MacOS Sonoma 14.0.

I'm assuming some compiler / linker flags are missing somewhere, however I couldn't find any install information in the docs.

Unfortunately installing with Conda is not an option, as I have to make this work with Poetry / PDM 😅

@xhochy xhochy transferred this issue from Quantco/glum Oct 11, 2023
@MarcAntoineSchmidtQC
Copy link
Member

I am able to replicate your issue. I still don't have a fix but I am working on it.

@rsayn
Copy link
Author

rsayn commented Oct 13, 2023

Thanks!

For the time being I managed to "hack" my PDM setup to reuse an existing Micromamba environment, and installed Glum and Tabmat with that.

It kinda works, but syncing the two is a pain so a fix would be super appreciated 👍

@jtilly
Copy link
Member

jtilly commented Oct 13, 2023

Looks a lot like #220 (comment), which was presumably fixed in #290. Maybe this wasn't as innocuous as it seemed?

@MarcAntoineSchmidtQC
Copy link
Member

I think you are right @jtilly. Our previous releases on arm were broken because they were missing the .dylibs folder. I tested a release on test.pypi and we now have it. I'll do a new release right now.

@MarcAntoineSchmidtQC
Copy link
Member

The latest 3.1.11 release did fix the original issue, but didn't fix all the problems with the apple silicon wheel. #315 should fix the remaining issue. I'll do a release once it is merged.

@MarcAntoineSchmidtQC
Copy link
Member

This issue was fixed with #317. I'm currently preparing the 3.1.12 release, which will contain the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants