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

Import Error #37

Open
kpmercier opened this issue Jul 15, 2024 · 4 comments
Open

Import Error #37

kpmercier opened this issue Jul 15, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@kpmercier
Copy link

Environment Information

  • spaceprime version:
  • Python version: 3.11.8
  • Operating System: MacOS 13.6.7

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'```
@kpmercier kpmercier added the bug Something isn't working label Jul 15, 2024
@connor-french
Copy link
Owner

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
Copy link
Owner

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:

  • created a clean python 3.11 environment
  • installed gdal with mamba install -c conda-forge gdal
  • install spaceprime with pip install git+https://github.com/connor-french/spaceprime
  • import spaceprime:
(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 connor-french mentioned this issue Jul 15, 2024
8 tasks
@connor-french
Copy link
Owner

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
Copy link
Owner

After some more digging, the msprime folks have encountered this issue as well, but it's on the back-burner until their next release (tskit-dev/msprime#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants