connor-french / spaceprime

A python package to facilitate spatially explicit coalescent modeling in msprime
MIT License
2 stars 0 forks source link

Import Error #37

Open kpmercier opened 3 months ago

kpmercier commented 3 months ago

Environment Information

Description

Installation seemed to go successfully, but receive an error when importing

What I Did


(sp_py11) katie@Anas-iMac ~ % python3
Python 3.11.8 | packaged by conda-forge | (main, Feb 16 2024, 20:51:20) [Clang 16.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import spaceprime as sp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/miniconda3/envs/sp_py11/lib/python3.11/site-packages/spaceprime/__init__.py", line 23, in <module>
    from spaceprime.demography import (
  File "/opt/miniconda3/envs/sp_py11/lib/python3.11/site-packages/spaceprime/demography.py", line 7, in <module>
    import msprime
  File "/opt/miniconda3/envs/sp_py11/lib/python3.11/site-packages/msprime/__init__.py", line 28, in <module>
    from msprime._msprime import (
ImportError: dlopen(/opt/miniconda3/envs/sp_py11/lib/python3.11/site-packages/msprime/_msprime.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '_gsl_rng_default'```
connor-french commented 3 months ago

Interesting. I'm going to try to replicate it in my environment. My suspicion is that it's a problem with msprime looking for its GSL installation, but it's not working due to conda and pip not playing together well.

connor-french commented 3 months ago

Hmm, I can't replicate it on my computer (MAC OSX 14.2.1). It shouldn't be a problem between 13.6-14.2, but that's all it seems it could be. Here's what I did:

(sptest) connorfrench connorfrench:~$ python3
Python 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:34:54) [Clang 16.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import spaceprime as sp
Matplotlib is building the font cache; this may take a moment.

Is that about what you did?

I'm going to create a test for installations on a MacOSX 13.x.x to investigate, but it'll take a bit. That's a weird error.

connor-french commented 3 months ago

Okay, so it looks like it's a Mac OSX version problem. It installs successfully on Mac OSX 14, but not on Mac OSX 13. It's an msprime issue, rather than a spaceprime issue, so this is a problem that may take a while to solve unfortunately. I'm hoping that doing everything through conda will magically solve the issue, but I'm going to work on a general solution.

connor-french commented 3 months ago

After some more digging, the msprime folks have encountered this issue as well, but it's on the back-burner until their next release (https://github.com/tskit-dev/msprime/issues/2285). Unfortunately, it looks like running the latest msprime/spaceprime in general on a MacOSX 13.X is impossible for now. I use some of the latest msprime features, otherwise I'd try using an earlier version for spaceprime.