Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

When will SciPy be available for M1 #161

Open
pro55b opened this issue Feb 8, 2021 · 13 comments
Open

When will SciPy be available for M1 #161

pro55b opened this issue Feb 8, 2021 · 13 comments

Comments

@pro55b
Copy link

pro55b commented Feb 8, 2021

I want to Use Keras but as there is a SciPy dependency this is not yet possible.
Any idea when SciPy will be available for M1.

@vashat
Copy link

vashat commented Feb 8, 2021

If you install it in a conda environment through miniforge you will have access to SciPy on M1.

@climatebrad
Copy link

Does anyone know when it will be available through other python installation pathways (e.g. pyenv)?

@lokinfey
Copy link

you can use conda

@mwidjaja1
Copy link

If you need help setting up conda, refer to the 'Miniforge' instructions on my issue: #153

PS: I do not believe Keras works (well) on M1 so your milage may vary there.

@lutzroeder
Copy link

scipy/scipy#13409

@pro55b
Copy link
Author

pro55b commented Feb 21, 2021

I got Keras working with Conda. Though I still had to build pillow with home-brew because I also use it and there was also some issue with h5py which I had to solve.

And as eager mode did not work I inserted the following in my code:

import tensorflow as tf
tf.compat.v1.disable_eager_execution()

gpu is working and it is fast !!

@phasheen
Copy link

phasheen commented Feb 21, 2021

Hi, I wonder how you installed keras? When I run conda install keras or conda install -c conda-forge kera here is what I got

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: | 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                          

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

I'm using a MacBook Air M1 , Minforge3 with Conda 4.9.2 python 3.9.1
I've tried conda config --set channel_priority flexible & conda update conda but didn't work.

here is my tensorflow environment detail:

absl-py                   0.11.0             pyhd8ed1ab_0    conda-forge
appnope                   0.1.2                    pypi_0    pypi
argon2-cffi               20.1.0                   pypi_0    pypi
astunparse                1.6.3              pyhd8ed1ab_0    conda-forge
async-generator           1.10                     pypi_0    pypi
attrs                     20.3.0                   pypi_0    pypi
backcall                  0.2.0                    pypi_0    pypi
bleach                    3.3.0                    pypi_0    pypi
ca-certificates           2020.12.5            h4653dfc_0    conda-forge
cachetools                4.2.1                    pypi_0    pypi
certifi                   2020.12.5        py38h10201cd_1    conda-forge
cffi                      1.14.5                   pypi_0    pypi
chardet                   4.0.0                    pypi_0    pypi
cycler                    0.10.0                     py_2    conda-forge
decorator                 4.4.2                    pypi_0    pypi
defusedxml                0.6.0                    pypi_0    pypi
entrypoints               0.3                      pypi_0    pypi
flatbuffers               1.12                     pypi_0    pypi
freetype                  2.10.4               h17b34a0_1    conda-forge
gast                      0.4.0              pyh9f0ad1d_0    conda-forge
google-auth               1.27.0                   pypi_0    pypi
google-auth-oauthlib      0.4.2                    pypi_0    pypi
google-pasta              0.2.0                    pypi_0    pypi
grpcio                    1.33.2                   pypi_0    pypi
h5py                      2.10.0                   pypi_0    pypi
idna                      2.10                     pypi_0    pypi
ipykernel                 5.4.3                    pypi_0    pypi
ipython                   7.20.0                   pypi_0    pypi
ipython-genutils          0.2.0                    pypi_0    pypi
ipywidgets                7.6.3                    pypi_0    pypi
jedi                      0.18.0                   pypi_0    pypi
jinja2                    2.11.3                   pypi_0    pypi
jpeg                      9d                   h27ca646_0    conda-forge
jsonschema                3.2.0                    pypi_0    pypi
jupyter                   1.0.0                    pypi_0    pypi
jupyter-client            6.1.11                   pypi_0    pypi
jupyter-console           6.2.0                    pypi_0    pypi
jupyter-core              4.7.1                    pypi_0    pypi
jupyterlab-pygments       0.1.2                    pypi_0    pypi
jupyterlab-widgets        1.0.0                    pypi_0    pypi
keras-preprocessing       1.1.2                    pypi_0    pypi
kiwisolver                1.3.1            py38h12a6f45_1    conda-forge
lcms2                     2.12                 had6a04f_0    conda-forge
libblas                   3.9.0                8_openblas    conda-forge
libcblas                  3.9.0                8_openblas    conda-forge
libcxx                    11.0.1               h168391b_0    conda-forge
libffi                    3.3                  h9f76cd9_2    conda-forge
libgfortran               5.0.0.dev0      11_0_0_hdc626ea_18    conda-forge
libgfortran5              11.0.0.dev0         hdc626ea_18    conda-forge
liblapack                 3.9.0                8_openblas    conda-forge
libopenblas               0.3.12          openmp_h2ecc587_1    conda-forge
libpng                    1.6.37               hf7e6567_2    conda-forge
libtiff                   4.2.0                h70663a0_0    conda-forge
libwebp-base              1.2.0                h27ca646_0    conda-forge
llvm-openmp               11.0.1               hb3022d6_0    conda-forge
lz4-c                     1.9.3                h9f76cd9_0    conda-forge
markdown                  3.3.3                    pypi_0    pypi
markupsafe                1.1.1                    pypi_0    pypi
matplotlib                3.3.4            py38h150bfb4_0    conda-forge
matplotlib-base           3.3.4            py38ha029820_0    conda-forge
mistune                   0.8.4                    pypi_0    pypi
nbclient                  0.5.2                    pypi_0    pypi
nbconvert                 6.0.7                    pypi_0    pypi
nbformat                  5.1.2                    pypi_0    pypi
ncurses                   6.2                  h9aa5885_4    conda-forge
nest-asyncio              1.5.1                    pypi_0    pypi
notebook                  6.2.0                    pypi_0    pypi
numpy                     1.20.1           py38h9e6c65a_0    conda-forge
oauthlib                  3.1.0                    pypi_0    pypi
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openssl                   1.1.1j               h27ca646_0    conda-forge
opt_einsum                3.3.0                      py_0    conda-forge
packaging                 20.9                     pypi_0    pypi
pandocfilters             1.4.3                    pypi_0    pypi
parso                     0.8.1                    pypi_0    pypi
pexpect                   4.8.0                    pypi_0    pypi
pickleshare               0.7.5                    pypi_0    pypi
pillow                    8.1.0            py38h5cebd47_2    conda-forge
pip                       21.0.1             pyhd8ed1ab_0    conda-forge
prometheus-client         0.9.0                    pypi_0    pypi
prompt-toolkit            3.0.16                   pypi_0    pypi
protobuf                  3.15.0                   pypi_0    pypi
ptyprocess                0.7.0                    pypi_0    pypi
pyasn1                    0.4.8                    pypi_0    pypi
pyasn1-modules            0.2.8                    pypi_0    pypi
pycparser                 2.20                     pypi_0    pypi
pygments                  2.8.0                    pypi_0    pypi
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyrsistent                0.17.3                   pypi_0    pypi
python                    3.8.6           h12cc5a1_5_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.8                      1_cp38    conda-forge
pyzmq                     22.0.3                   pypi_0    pypi
qtconsole                 5.0.2                    pypi_0    pypi
qtpy                      1.9.0                    pypi_0    pypi
readline                  8.0                  hc8eb9b7_2    conda-forge
requests                  2.25.1                   pypi_0    pypi
requests-oauthlib         1.3.0                    pypi_0    pypi
rsa                       4.7.1                    pypi_0    pypi
scipy                     1.6.0            py38hdf044fb_0    conda-forge
send2trash                1.5.0                    pypi_0    pypi
setuptools                49.6.0           py38h10201cd_3    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
sqlite                    3.34.0               h6d56c25_0    conda-forge
tensorboard               2.4.1                    pypi_0    pypi
tensorboard-plugin-wit    1.8.0                    pypi_0    pypi
tensorflow                2.4.0rc0                 pypi_0    pypi
tensorflow-addons         0.11.2                   pypi_0    pypi
tensorflow-estimator      2.4.0                    pypi_0    pypi
termcolor                 1.1.0                      py_2    conda-forge
terminado                 0.9.2                    pypi_0    pypi
testpath                  0.4.4                    pypi_0    pypi
tk                        8.6.10               hf7e6567_1    conda-forge
tornado                   6.1              py38h30f7421_1    conda-forge
traitlets                 5.0.5                    pypi_0    pypi
typeguard                 2.11.1             pyhd8ed1ab_0    conda-forge
typing_extensions         3.7.4.3                    py_0    conda-forge
urllib3                   1.26.3                   pypi_0    pypi
wcwidth                   0.2.5                    pypi_0    pypi
webencodings              0.5.1                    pypi_0    pypi
werkzeug                  1.0.1                    pypi_0    pypi
wheel                     0.36.2             pyhd3deb0d_0    conda-forge
widgetsnbextension        3.5.1                    pypi_0    pypi
wrapt                     1.12.1                   pypi_0    pypi
xz                        5.2.5                h642e427_1    conda-forge
zlib                      1.2.11            h31e879b_1009    conda-forge
zstd                      1.4.8                h5b28eab_1    conda-forge

@pro55b
Copy link
Author

pro55b commented Feb 21, 2021 via email

@pro55b
Copy link
Author

pro55b commented Feb 21, 2021

This is my environment detail:

Name Version Build Channel

absl-py 0.11.0 pypi_0 pypi
appnope 0.1.2 py38h10201cd_1 conda-forge
astunparse 1.6.3 pypi_0 pypi
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.1 py_0 conda-forge
c-ares 1.17.1 h27ca646_0 conda-forge
ca-certificates 2020.12.5 h4653dfc_0 conda-forge
cached-property 1.5.1 py_0 conda-forge
cachetools 4.2.1 pypi_0 pypi
certifi 2020.6.20 pyhd3eb1b0_3
chardet 4.0.0 pypi_0 pypi
cycler 0.10.0 pypi_0 pypi
decorator 4.4.2 py_0 conda-forge
flatbuffers 1.12 pypi_0 pypi
freetype 2.10.4 h17b34a0_1 conda-forge
gast 0.4.0 pypi_0 pypi
google-auth 1.26.1 pypi_0 pypi
google-auth-oauthlib 0.4.2 pypi_0 pypi
google-pasta 0.2.0 pypi_0 pypi
grpcio 1.35.0 py38h446835f_0 conda-forge
h5py 3.1.0 nompi_py38h032b01a_100 conda-forge
hdf5 1.10.6 nompi_h0fc092c_1114 conda-forge
idna 2.10 pypi_0 pypi
install 1.3.4 pypi_0 pypi
ipython 7.20.0 py38h2cb4d76_2 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
jedi 0.18.0 py38h10201cd_2 conda-forge
jpeg 9d h27ca646_0 conda-forge
keras 2.4.3 pypi_0 pypi
keras-preprocessing 1.1.2 pypi_0 pypi
kiwisolver 1.3.1 pypi_0 pypi
krb5 1.17.2 h17618d6_0 conda-forge
lcms2 2.12 had6a04f_0 conda-forge
libblas 3.9.0 8_openblas conda-forge
libcblas 3.9.0 8_openblas conda-forge
libcurl 7.71.1 hd2aec06_8 conda-forge
libcxx 11.0.1 h168391b_0 conda-forge
libedit 3.1.20191231 hc8eb9b7_2 conda-forge
libev 4.33 h642e427_1 conda-forge
libffi 3.3 h9f76cd9_2 conda-forge
libgfortran 5.0.0.dev0 11_0_0_hdc626ea_18 conda-forge
libgfortran5 11.0.0.dev0 hdc626ea_18 conda-forge
liblapack 3.9.0 8_openblas conda-forge
libnghttp2 1.43.0 hf3018f0_0 conda-forge
libopenblas 0.3.12 openmp_h2ecc587_1 conda-forge
libpng 1.6.37 hf7e6567_2 conda-forge
libssh2 1.9.0 h1c49ba1_5 conda-forge
libtiff 4.2.0 h70663a0_0 conda-forge
libwebp-base 1.2.0 h27ca646_0 conda-forge
llvm-openmp 11.0.1 hb3022d6_0 conda-forge
lz4-c 1.9.3 h9f76cd9_0 conda-forge
markdown 3.3.3 pypi_0 pypi
matplotlib 3.3.4 pypi_0 pypi
ncurses 6.2 h9aa5885_4 conda-forge
numpy 1.20.1 py38h9e6c65a_0 conda-forge
oauthlib 3.1.0 pypi_0 pypi
olefile 0.46 py_0
openssl 1.1.1j h27ca646_0 conda-forge
opt-einsum 3.3.0 pypi_0 pypi
parso 0.8.1 pyhd8ed1ab_0 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 8.1.0 py38h5cebd47_2 conda-forge
pip 20.2.4 py_0 conda-forge
prompt-toolkit 3.0.16 pyha770c72_0 conda-forge
protobuf 3.14.0 pypi_0 pypi
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pyasn1 0.4.8 pypi_0 pypi
pyasn1-modules 0.2.8 pypi_0 pypi
pygments 2.7.4 pyhd8ed1ab_0 conda-forge
pyparsing 2.4.7 pypi_0 pypi
python 3.8.6 h12cc5a1_5_cpython conda-forge
python-dateutil 2.8.1 pypi_0 pypi
python_abi 3.8 1_cp38 conda-forge
pyyaml 5.4.1 pypi_0 pypi
readline 8.0 hc8eb9b7_2 conda-forge
requests 2.25.1 pypi_0 pypi
requests-oauthlib 1.3.0 pypi_0 pypi
rsa 4.7 pypi_0 pypi
scipy 1.6.0 py38hdf044fb_0 conda-forge
setuptools 49.6.0 py38h10201cd_3 conda-forge
six 1.15.0 pyh9f0ad1d_0 conda-forge
sqlite 3.34.0 h6d56c25_0 conda-forge
tensorboard 2.4.1 pypi_0 pypi
tensorboard-plugin-wit 1.8.0 pypi_0 pypi
tensorflow 2.4.0rc0 pypi_0 pypi
tensorflow-addons 0.11.2 pypi_0 pypi
tensorflow-estimator 2.4.0 pypi_0 pypi
termcolor 1.1.0 py_2 conda-forge
tk 8.6.10 hf7e6567_1 conda-forge
traitlets 5.0.5 py_0 conda-forge
typeguard 2.9.1 py_0 conda-forge
typing-extensions 3.7.4.3 pypi_0 pypi
urllib3 1.26.3 pypi_0 pypi
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
werkzeug 1.0.1 pypi_0 pypi
wheel 0.36.2 pyhd3deb0d_0 conda-forge
wrapt 1.12.1 pypi_0 pypi
xz 5.2.5 h642e427_1 conda-forge
zlib 1.2.11 h31e879b_1009 conda-forge
zstd 1.4.8 h5b28eab_1 conda-forge

@phasheen
Copy link

phasheen commented Feb 21, 2021

oh my god, I tried pip install before and didn't work, but it worked just now.
I figured that was because I didn't install scipy before, and pip install keras will fail to install scipy. Later I installed Scipy with conda, but never tried pip again.
Thank you!

@pro55b
Copy link
Author

pro55b commented Feb 21, 2021

SciPy is installed with the environment.yml mentioned in the article #153

@hjmr
Copy link

hjmr commented Feb 24, 2021

Does anyone know when it will be available through other python installation pathways (e.g. pyenv)?

It can be manually installed using pip.

 $ NPY_DISTUTILS_APPEND_FLAGS=1 CFLAGS="-falign-functions=8 ${CFLAGS}" pip install scipy

You need gcc (and probably some other utilities) installed via Homebrew. The option "NPY_DISTUTILS_APPEND_FLAGS=1" is required when compiling for Python 3.8 (not necessary for 3.9).

@hjmr
Copy link

hjmr commented Feb 25, 2021

A fix for gcc has been reflected in the latest Homebrew a few days ago, and the workaround of -falign-functions=8 becomes unnecessary anymore. Add the following lines to ~/.numpy-site.cfg to use Homebrew's OpenBLAS:

[openblas]
libraries = openblas
library_dirs = /opt/homebrew/opt/openblas/lib
include_dirs = /opt/homebrew/opt/openblas/include

And then, you can install SciPy in the usual way.

 $ NPY_DISTUTILS_APPEND_FLAGS=1 pip install scipy

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants