Skip to content

BUG: "import numpy" on Mac OS X raised the error "Library not loaded: @rpath/libgfortran.5.dylib" #29319

Open
@steffenschroe

Description

@steffenschroe

Describe the issue:

After a fresh install of Miniconda version 25.5.1 I installed a new environment via:

conda env create -f  macos_arm64_env.lock.yml -n thermca

from https://github.com/steffenschroe/Thermca/blob/main/macos_arm64_env.lock.yml

After activating the environment, Numpy could not be imported.

Reproduce the code example:

(thermca) schroeder@Mac ~ % python
Python 3.12.7 | packaged by conda-forge | (main, Oct  4 2024, 15:57:01) [Clang 17.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
Traceback (most recent call last):
  File "/opt/miniconda3/envs/thermca/lib/python3.12/site-packages/numpy/_core/__init__.py", line 23, in <module>
    from . import multiarray
  File "/opt/miniconda3/envs/thermca/lib/python3.12/site-packages/numpy/_core/multiarray.py", line 10, in <module>
    from . import overrides
  File "/opt/miniconda3/envs/thermca/lib/python3.12/site-packages/numpy/_core/overrides.py", line 8, in <module>
    from numpy._core._multiarray_umath import (
ImportError: dlopen(/opt/miniconda3/envs/thermca/lib/python3.12/site-packages/numpy/_core/_multiarray_umath.cpython-312-darwin.so, 0x0002): Library not loaded: @rpath/libgfortran.5.dylib
  Referenced from: <0A2DCABF-4965-37A0-AAB0-766832632FAF> /opt/miniconda3/envs/thermca/lib/liblapack-netlib.3.9.0.dylib
  Reason: tried: '/opt/miniconda3/envs/thermca/lib/libgfortran.5.dylib' (duplicate LC_RPATH '@loader_path'), '/opt/miniconda3/envs/thermca/lib/libgfortran.5.dylib' (duplicate LC_RPATH '@loader_path'), '/opt/miniconda3/envs/thermca/lib/libgfortran.5.dylib' (duplicate LC_RPATH '@loader_path'), '/opt/miniconda3/envs/thermca/lib/python3.12/site-packages/numpy/_core/../../../../libgfortran.5.dylib' (duplicate LC_RPATH '@loader_path'), '/opt/miniconda3/envs/thermca/lib/python3.12/site-packages/numpy/_core/../../../../libgfortran.5.dylib' (duplicate LC_RPATH '@loader_path'), '/opt/miniconda3/envs/thermca/bin/../lib/libgfortran.5.dylib' (duplicate LC_RPATH '@loader_path'), '/opt/miniconda3/envs/thermca/bin/../lib/libgfortran.5.dylib' (duplicate LC_RPATH '@loader_path'), '/usr/local/lib/libgfortran.5.dylib' (no such file), '/usr/lib/libgfortran.5.dylib' (no such file, not in dyld cache)

Error message:

Python and NumPy Versions:

python 3.12.7
numpy 2.0.2

further versions are in the yml file

Runtime Environment:

No response

Context for the issue:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    00 - Bug57 - Close?Issues which may be closable unless discussion continued

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions