apple silicon m1 can't importing sklearn package.

I have been finished install Tensorflow env step by step from "https://developer.apple.com/metal/tensorflow-plugin/" 
Tf is working! but when i import sklearn package, have an error message like this:

```
ImportError: dlopen(/Users/mecilmeng/miniforge3/envs/tf/lib/python3.9/site-packages/scipy/spatial/qhull.cpython-39-darwin.so, 0x0002):
Library not loaded: @rpath/liblapack.3.dylib
Referenced from: /Users/mecilmeng/miniforge3/envs/tf/lib/python3.9/site-packages/scipy/spatial/qhull.cpython-39-darwin.so
Reason: tried:
'/Users/mecilmeng/miniforge3/envs/tf/lib/liblapack.3.dylib' (no such file),
'/Users/mecilmeng/miniforge3/envs/tf/lib/liblapack.3.dylib' (no such file),
'/Users/mecilmeng/miniforge3/envs/tf/lib/python3.9/site-packages/scipy/spatial/../../../../liblapack.3.dylib' (no such file),
'/Users/mecilmeng/miniforge3/envs/tf/lib/liblapack.3.dylib' (no such file),
'/Users/mecilmeng/miniforge3/envs/tf/lib/liblapack.3.dylib' (no such file),
'/Users/mecilmeng/miniforge3/envs/tf/lib/python3.9/site-packages/scipy/spatial/../../../../liblapack.3.dylib' (no such file), 
'/Users/mecilmeng/miniforge3/envs/tf/bin/../lib/liblapack.3.dylib' (no such file), 
'/Users/mecilmeng/miniforge3/envs/tf/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)
```

![image](https://user-images.githubusercontent.com/2948534/154528617-80c89cd3-f74c-4d94-a7a9-154fafd9c882.png)

How to fix it?

pip list
```
Package                  Version
------------------------ -------------------
absl-py                  0.10.0
aiohttp                  3.8.1
aiosignal                1.2.0
anyio                    3.5.0
appnope                  0.1.2
argon2-cffi              20.1.0
astunparse               1.6.3
async-generator          1.10
async-timeout            4.0.1
attrs                    21.4.0
Babel                    2.9.1
backcall                 0.2.0
beniget                  0.3.0
bleach                   4.1.0
blinker                  1.4
Bottleneck               1.3.2
brotlipy                 0.7.0
cached-property          1.5.2
cachetools               4.2.2
certifi                  2021.10.8
cffi                     1.15.0
charset-normalizer       2.0.4
click                    8.0.3
cryptography             3.4.7
cycler                   0.11.0
Cython                   0.29.28
debugpy                  1.5.1
decorator                5.1.1
defusedxml               0.7.1
dill                     0.3.4
entrypoints              0.3
flatbuffers              2.0
fonttools                4.25.0
frozenlist               1.2.0
gast                     0.4.0
google-auth              1.33.0
google-auth-oauthlib     0.4.1
google-pasta             0.2.0
googleapis-common-protos 1.54.0
grpcio                   1.42.0
h5py                     3.1.0
idna                     3.3
importlib-metadata       4.8.2
ipykernel                6.4.1
ipython                  7.31.1
ipython-genutils         0.2.0
jedi                     0.18.1
Jinja2                   3.0.2
joblib                   1.1.0
json5                    0.9.6
jsonschema               3.2.0
jupyter-client           7.1.2
jupyter-core             4.9.1
jupyter-server           1.13.5
jupyterlab               3.2.1
jupyterlab-pygments      0.1.2
jupyterlab-server        2.10.3
keras                    2.8.0
Keras-Preprocessing      1.1.2
kiwisolver               1.3.1
libclang                 13.0.0
Markdown                 3.3.4
MarkupSafe               2.0.1
matplotlib               3.5.0
matplotlib-inline        0.1.2
mistune                  0.8.4
multidict                5.2.0
munkres                  1.1.4
nbclassic                0.2.6
nbclient                 0.5.3
nbconvert                6.3.0
nbformat                 5.1.3
nest-asyncio             1.5.1
networkx                 2.6.3
notebook                 6.4.6
numexpr                  2.8.1
numpy                    1.22.2
oauthlib                 3.1.1
opencv-python            4.5.5.62
opt-einsum               3.3.0
packaging                21.3
pandas                   1.3.5
pandocfilters            1.5.0
parso                    0.8.3
pexpect                  4.8.0
pickleshare              0.7.5
Pillow                   9.0.1
pip                      21.2.4
ply                      3.11
prometheus-client        0.13.1
promise                  2.3
prompt-toolkit           3.0.20
protobuf                 3.19.1
ptyprocess               0.7.0
pyasn1                   0.4.8
pyasn1-modules           0.2.8
pybind11                 2.9.1
pycparser                2.21
Pygments                 2.11.2
PyJWT                    2.1.0
pyOpenSSL                21.0.0
pyparsing                3.0.4
pyrsistent               0.18.0
PySocks                  1.7.1
python-dateutil          2.8.2
pythran                  0.9.11
pytz                     2021.3
pyzmq                    22.3.0
requests                 2.27.1
requests-oauthlib        1.3.0
rsa                      4.7.2
scikit-learn             1.0.2
scipy                    1.7.1
Send2Trash               1.8.0
setuptools               58.0.4
six                      1.15.0
sklearn                  0.0
sniffio                  1.2.0
tensorboard              2.8.0
tensorboard-data-server  0.6.1
tensorboard-plugin-wit   1.6.0
tensorflow-datasets      4.5.2
tensorflow-macos         2.8.0
tensorflow-metadata      1.6.0
tensorflow-metal         0.3.0
termcolor                1.1.0
terminado                0.13.1
testpath                 0.5.0
tf-estimator-nightly     2.8.0.dev2021122109
threadpoolctl            2.2.0
tornado                  6.1
tqdm                     4.62.3
traitlets                5.1.1
typing-extensions        3.7.4.3
urllib3                  1.26.8
wcwidth                  0.2.5
webencodings             0.5.1
websocket-client         0.58.0
Werkzeug                 2.0.2
wheel                    0.35.1
wrapt                    1.12.1
yarl                     1.6.3
zipp                     3.7.0
```

COMMENT:
NOTE: This answer is for `macOS` users only, and involves copying dilyb(s) that may not be compatible all versions of sklearn.
I highly recommend trying to re-install the packages first.
If you continue to fail and have reached a point where you are willing to try anything, the following steps may resolve the issue.


I was able to resolve this by manually copying over a copy of the necessary `dylib`(s) out of a homebrew installation.
First: I ran `brew install lapack`
[NOTE: For me, this installed version (3.11), you may end up with a different version after running the command]
Then I identified all the relevant files in of `/opt/homebrew/Cellar/lapack/3.11/lib/*`:
```
liblapacke.dylib
libblas.3.11.0.dylib
libblas.3.dylib
libblas.dylib
liblapack.3.11.0.dylib
liblapack.3.dylib
liblapack.dylib
liblapacke.3.11.0.dylib
liblapacke.3.dylib
```
Identify a search path that I all my python packages would search.
I'm using miniconda for my python environment management, for me it was: `~/miniconda3/envs/maxEnt/lib/`.

Step 1:
Delete all existing files with a matching name in this `lib` folder.

Step 2:
Copy the files referenced above.

Step 3:
Update all the symlinks (aliases) in these files [`.dylib` points to 3.11.0.dylib; `.3.dylib` points to `3.11.0.dylib`].

Labels: Question