msprime icon indicating copy to clipboard operation
msprime copied to clipboard

Issue importing msprime into Python

Open asadrh8 opened this issue 1 year ago • 8 comments

Hello!

I've installed msprime using pip, but am met with the following error when I attempt to import it into JupyterLab.

Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/msprime/init.py", line 28, in from msprime._msprime import ( ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/msprime/_msprime.cpython-310-darwin.so, 2): Library not loaded: @rpath/libgsl.25.dylib Referenced from: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/msprime/_msprime.cpython-310-darwin.so Reason: image not found

I've also attempted installing it with conda, activating a conda environment, and am met with the same error. I'm really unsure of what's going on haha.

Thank you! Asad

asadrh8 avatar Jul 15 '22 02:07 asadrh8

Hi @asadrh8 :wave:

It's odd you should get the same error when using conda. Can you try installing msprime into a fresh conda environment (see docs) and let us know how you get on?

jeromekelleher avatar Jul 15 '22 08:07 jeromekelleher

I ended up with the same error. I'm really unsure of what's going on given that the installation always run smoothly. Is it perhaps a python compatibility issue? I'm running python 3.10.4.

asadrh8 avatar Jul 15 '22 18:07 asadrh8

Just to update, I reverted to python 3.9.12 and am no longer experiencing the error. Everything is working fine!

asadrh8 avatar Jul 15 '22 23:07 asadrh8

This is macOS? It'd be nice to confirm this. What macOS version are you on? I can try to replicate next week on a machine running Monterey.

molpopgen avatar Jul 16 '22 12:07 molpopgen

I'm on macOS Mojave, 10.14.6!

asadrh8 avatar Jul 18 '22 23:07 asadrh8

Thanks. I just updated a machine to that. It looks to me like you installed stuff into system libraries? I'm basing that on the paths. That may be part of the issues.

molpopgen avatar Jul 18 '22 23:07 molpopgen

@asadrh8 do you still have this problem? Can you check if installing msprime into its own environment using conda solves the problem (see #2093 for help on doing this)?

jeromekelleher avatar Jul 26 '22 13:07 jeromekelleher

I didn't get around to firing up my Mac yet. It isn't my daily driver and I am easily distracted!

molpopgen avatar Jul 26 '22 17:07 molpopgen

I'm going to close this as there's no updates after a few months - we can reopen if it's still a live issue.

jeromekelleher avatar Dec 05 '22 14:12 jeromekelleher