dpeerlab / Palantir

Single cell trajectory detection
https://palantir.readthedocs.io
GNU General Public License v2.0
203 stars 45 forks source link

Runtime error during import of Palantir #115

Closed 16nikita closed 11 months ago

16nikita commented 11 months ago

I work on a MacBook pro with an m1 chip. Palantir successfully installs, but when I try to import the module, it produces an error: RuntimeError: This version of jaxlib was built using AVX instructions, which your CPU and/or operating system do not support. You may be able work around this issue by building jaxlib from source.

I have tried solutions such as upgrading jaxlib and jax packages but these solutions only create more errors. Are there any workarounds for this issue?

katosh commented 11 months ago

Hi @16nikita, thank you for reporting this issue. The error you're experiencing likely stems from compatibility issues with the M1 chip's ARM architecture and jaxlib's AVX instructions. You might try:

pip install jax jaxlib

If that doesn't work, more detailed instructions are available at https://github.com/google/jax#installation.

Please let me know if this resolves the issue for you.

16nikita commented 11 months ago

Hi, thank you for the rapid response. I have tried this and it resulted in a new error: AttributeError: partially initialized module 'jax' has no attribute 'version' (most likely due to a circular import) I'll try looking through jax documentation. Do you have any other ideas?

katosh commented 11 months ago

The error came up here: https://github.com/google/jax/discussions/14036 Maybe restarting the python kernel can resolve this.

16nikita commented 11 months ago

I have tried the solutions in that thread, but nothing worked for me- thanks again.

katosh commented 11 months ago

If you need a quick solution and the newer functions of Palantir v1.3.0 are not critical for your work, you can fall back to an older version that does not depend on Mellon and Jax. You can do this by running:

pip install palantir==1.2.0

This should bypass the problem with jaxlib. If you need further assistance or have any more issues, please don't hesitate to reach out.

16nikita commented 11 months ago

Thank you so much for your help, this solution works for me temporarily!