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

I just did exactly the same and I have still :

File ~/miniconda3/envs/fenics-env/lib/python3.10/site-packages/dolfinx/common.py:11
from dolfinx import cpp as _cpp

ImportError: dlopen(/Users/raphaeljean/miniconda3/envs/fenics-env/lib/python3.10/site-packages/dolfinx/cpp.cpython-310-darwin.so, 0x0002): Symbol not found: __ZN3tbb4task13note_affinityEt
Referenced from: <71DD661F-C833-3D14-932A-39793E7AF327> /Users/raphaeljean/miniconda3/envs/fenics-env/lib/libspqr.2.0.9.dylib
Expected in: /Users/raphaeljean/miniconda3/envs/fenics-env/lib/libtbb.12.11.dylib

Hello @Raphael-Jean,

I hope you solved your problem. Personally, I’m using anaconda, not miniconda3. I did not do anything fancy for the installation of fenics-dolfinx V0.6. I’ve just used one virtual env and conda-forge has my install channel with one of these commands:

conda install -c conda-forge fenics-dolfinx=0.6
conda install --channel conda-forge fenics-dolfinx=0.6
conda install conda-forge:: fenics-dolfinx=0.6