Problems with Conda installation for FENICSX on apple silicon

All,

Installed FENICSX using CONDA today. Installation went smoothly but when trying to run the following demo i received this error, Note that I am attempting to run it in Jupyter Lab (Not using the DOCKER image).

Code:
import numpy as np

import ufl
from dolfinx import fem, io, mesh, plot
from ufl import ds, dx, grad, inner

from mpi4py import MPI
from petsc4py.PETSc import ScalarType

Errors:

ImportError Traceback (most recent call last)
Input In [3], in <cell line: 4>()
1 import numpy as np
3 import ufl
----> 4 from dolfinx import fem, io, mesh, plot
5 from ufl import ds, dx, grad, inner
7 from mpi4py import MPI

File ~/miniconda3/lib/python3.9/site-packages/dolfinx/init.py:29, in
23 # Reset dl open flags
24 # sys.setdlopenflags(stored_dlopen_flags)
25 # del sys
27 import sys
—> 29 from dolfinx import common
30 from dolfinx import cpp as _cpp
31 from dolfinx import fem, geometry, graph, io, jit, la, log, mesh, nls, plot

File ~/miniconda3/lib/python3.9/site-packages/dolfinx/common.py:10, in
6 “”“General tools for timing and configuration”“”
8 import functools
—> 10 from dolfinx import cpp as _cpp
11 from dolfinx.cpp.common import (IndexMap, git_commit_hash, has_adios2, # noqa
12 has_debug, has_kahip, has_parmetis)
14 all = [“IndexMap”, “Timer”, “timed”]

ImportError: dlopen(/Users/msacks/miniconda3/lib/python3.9/site-packages/dolfinx/cpp.cpython-39-darwin.so, 0x0002): Library not loaded: ‘@rpath/libblas.3.dylib’
Referenced from: ‘/Users/msacks/miniconda3/lib/libbasix.dylib’
Reason: tried: ‘/Users/msacks/miniconda3/lib/libblas.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/lib/libblas.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/lib/python3.9/site-packages/dolfinx/…/…/…/libblas.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/lib/python3.9/site-packages/dolfinx/…/…/…/libblas.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/bin/…/lib/libblas.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/bin/…/lib/libblas.3.dylib’ (no such file), ‘/usr/local/lib/libblas.3.dylib’ (no such file), ‘/usr/lib/libblas.3.dylib’ (no such file)Library not loaded: ‘@rpath/liblapack.3.dylib’
Referenced from: ‘/Users/msacks/miniconda3/lib/libslepc.3.17.1.dylib’
Reason: tried: ‘/Users/msacks/miniconda3/lib/liblapack.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/lib/liblapack.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/lib/python3.9/site-packages/dolfinx/…/…/…/liblapack.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/lib/python3.9/site-packages/dolfinx/…/…/…/liblapack.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/bin/…/lib/liblapack.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/bin/…/lib/liblapack.3.dylib’ (no such file), ‘/usr/local/lib/liblapack.3.dylib’ (no such file), ‘/usr/lib/liblapack.3.dylib’ (no such file)Library not loaded: ‘@rpath/liblapack.3.dylib’
Referenced from: ‘/Users/msacks/miniconda3/lib/libpetsc.3.17.3.dylib’
Reason: tried: ‘/Users/msacks/miniconda3/lib/liblapack.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/lib/liblapack.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/lib/python3.9/site-packages/dolfinx/…/…/…/liblapack.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/lib/python3.9/site-packages/dolfinx/…/…/…/liblapack.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/bin/…/lib/liblapack.3.dylib’ (no such file), ‘/Users/msacks/miniconda3/bin/…/lib/liblapack.3.dylib’ (no such file), ‘/usr/local/lib/liblapack.3.dylib’ (no such file), ‘/usr/lib/liblapack.3.dylib’ (no such file)

1 Like

I am getting the exact same error message. Were you able to resolve it?

Hello,

I’m on apple silicon too, I create a virtual env with conda and I install matplotlib, Jupyter and Fenicsx (fenics-dolfinx, mpich, pyvista) with the conda-forge channel and it works with python 3.10.

1 Like