Library not loaded: @rpath/libopenblas.dylib

FEniCS version: 2019.1.0 via Conda
Platform: MacOS

Hello,

I have recently installed a python library (pymc3, which I believe does NOT depend on FEniCS) under Conda fenicsproject environment ($ conda activate fenicsproject , I installed pymc3 under fenicsproject environment so I could later interface them. )

However, when I tested pymc3 installation with python3 3 -c "import pymc3 as pm" , I received the following error on FEniCS, anyone know how to fix this? Thanks!

Traceback (most recent call last):
File “”, line 1, in
File “//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/pymc3/init.py”, line 5, in
from .distributions import *
File “//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/pymc3/distributions/init.py”, line 1, in
from . import timeseries
File “//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/pymc3/distributions/timeseries.py”, line 1, in
from scipy import stats
File “//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/scipy/stats/init.py”, line 367, in
from .stats import *
File “//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/scipy/stats/stats.py”, line 172, in
import scipy.special as special
File “//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/scipy/special/init.py”, line 641, in
from ._ufuncs import *
ImportError: dlopen(//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/scipy/special/_ufuncs.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libopenblas.dylib
Referenced from: //anaconda3/envs/fenicsproject/lib/python3.7/site-packages/scipy/special/_ufuncs.cpython-37m-darwin.so
Reason: image not found

I just installed libopenblas via Conda $ conda install -c anaconda libopenblas , and the issue was not resolved yet:

Traceback (most recent call last):
File “”, line 1, in
File “//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/pymc3/init.py”, line 5, in
from .distributions import *
File “//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/pymc3/distributions/init.py”, line 1, in
from . import timeseries
File “//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/pymc3/distributions/timeseries.py”, line 1, in
from scipy import stats
File “//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/scipy/stats/init.py”, line 367, in
from .stats import *
File “//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/scipy/stats/stats.py”, line 172, in
import scipy.special as special
File “//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/scipy/special/init.py”, line 641, in
from ._ufuncs import *
ImportError: dlopen(//anaconda3/envs/fenicsproject/lib/python3.7/site-packages/scipy/special/_ufuncs.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libopenblas.dylib
Referenced from: //anaconda3/envs/fenicsproject/lib/python3.7/site-packages/scipy/special/_ufuncs.cpython-37m-darwin.so
Reason: image not found

Hi, it could be related to: https://github.com/numpy/numpy/issues/14165
Have you tried rolling back the installation of openblas to 0.3.3?
Possible fix is Also listed here
https://github.com/numpy/numpy/issues/12970

Hi dokken

I haven’t tried rolling back to older versions yet, I just ran this command $ $ conda list | grep openblas and it returns a few things related to openblas:

blas 2.13 openblas conda-forge
libblas 3.8.0 13_openblas conda-forge
libcblas 3.8.0 13_openblas conda-forge
liblapack 3.8.0 13_openblas conda-forge
liblapacke 3.8.0 13_openblas conda-forge
libopenblas 0.3.7 h4bb4525_1 conda-forge

Do you know which one I should roll back, and how to roll back?

Thank you!