You must install the Xcode Command Line Tools. The following sections describe the prerequisites for installing OR-Tools. Have only tested them on machines meeting the following requirements: OR-Tools, we recommend the package installation.Īlthough these instructions might also work on other MacOS variants, we Unless you plan to modify the source code or use a third-party solver with It appears that there is a lot currently changing with respect to Apple M1 support, so this might become still easier soon.This guide explains how to build from source OR-Tools, with support for I needed the older numpy version because there is also tensorflow installed in this environment which is not compatible with newer numpy versions I do not know whether your newer numpy could contribute to the problems you encountered. There were the Apple developer tools (XCode, xcode-select) and some other packages installed via homebrew, and in a pyenv virtualenv environment before, which might also be relevant, so I add them here below: brew install openblas pkg-config pyenv pyenv-virtualenv So the information on the scikit-learn homepage about the conda installation path being necessary is outdated, it seems. Python -m pip install -no-use-pep517 scikit-learn"=0.24.2" Python -m pip install -no-cache -no-binary :all: -no-use-pep517 scipy"=1.7.1" Python -m pip install -no-cache -no-use-pep517 pythran cython pybind11 gast"=0.4.0" I just had success using the following sequence of commands, base on Python 3.8.11 (especially scipy compilation took some time, so this process is not a quick one, unfortunately): # SciPy: I do not know why numpy would be built again (maybe scipy has other version requirements?), but I can report on a way how to install scipy and scikit-learn. # later in the process it installs using setuptools Here apparently we had no wheel available, so we have to build it ourselves with setuptools running setup.py. Here we are downloading a pre-built wheel that has very few limitations: it works for any version of python 3, for any os, for any architecture (like amd64 or arm64): click-8.0.3-p圓-none-any.whl Collecting click>=7.0 Building the wheel ourselves takes more cpu time, and is generally less reliable but works in this case. This happens because the authors don't publish a prebuilt wheel to Pipy, but more and more people are adding this to their CI (github actions) workflow. Or, if no prebuilt wheel exists (sad) then we download a tar.gz and build it ourselves. Note on Pipy: we usually download either a pre-built wheel (yay, this is excellent for reliable distribution and ensuring compatability). Successfully installed scikit-learn-1.0.1 scipy-1.7.3 Installing collected packages: scipy, scikit-learn Building wheels for collected packages: scikit-learnīuilding wheel for scikit-learn (pyproject.toml). Pip downloaded the source from Pipy, then built the wheel targeting MacOS X 12.0, and arm64 (apple silicon): scikit_learn-1.0.1-cp38-cp38-macosx_12_0_arm64.whl. Worked great on Apple Silicon M1 □ Extra details about how Pip works Just first brew install openblas - it has instructions for different processors ( wikipedia) brew install openblasĮxport OPENBLAS=$(/opt/homebrew/bin/brew -prefix openblas)Įxport CFLAGS="-falign-functions=8 $"
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |