简体   繁体   中英

Why do I get an MKL error when running my python script on MacOS

I have a python script that was converted from an.ipynb notebook from Google Colab that I'm trying to run natively on my Mac running Big Sur.

When I try to run the script using python scriptname.py it gives me the following error:

NTEL MKL ERROR: dlopen(/Users/MyUser/opt/anaconda3/lib/libmkl_core.dylib, 9): image not found.
Intel MKL FATAL ERROR: Cannot load libmkl_core.dylib.

It occurs immediately after I try to import pandas .

I tried conda update numpy as suggested here but the problem persists.

I wondered if I didn't have pandas installed but I did pip install pandas and I got Requirement already satisfied for all 6 packages.

Any help would be appreciated.

Try following, to make sure it's not something with your conda stuff.

> python3 -m venv venv-38
> source venv-38/bin/activate
(venv-38) > pip3 install pandas
...
...
(venv-38) > python
Python 3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
>>> quit()

** Update **

You can easily reuse this environment in all future terminal sessions. Let's say you have this venv-38 inside $HOME . All you have to do is to open terminal session, and then

> source $HOME/venv-38/bin/activate

since now, your Python environment will be used as if it was installed inside venv-38 directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM