Skip to content

fix: Installation - Unable to install on Macbook Monterey M2 #101

@sightama

Description

@sightama

Don't forget to assign:

  • Project
  • Milestone (if any)

Environment: dev - locally inside venv

Actual Behaviour

When I try to install via 'pip install ydata-quality' I get the below errors:

...
clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DNO_ATLAS_INFO=3 -DHAVE_CBLAS -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/umath -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/npymath -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-12-arm64-3.8/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Users/lanekubicki/projects/fletcher/venv/include -I/opt/homebrew/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/include/python3.8 -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/common -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/npymath -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/common -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/npymath -c numpy/core/src/multiarray/conversion_utils.c -o build/temp.macosx-12-arm64-cpython-38/numpy/core/src/multiarray/conversion_utils.o -MMD -MF build/temp.macosx-12-arm64-cpython-38/numpy/core/src/multiarray/conversion_utils.o.d -faltivec -I/System/Library/Frameworks/vecLib.framework/Headers" failed with exit status 1
            [end of output]
        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: legacy-install-failure
      
      × Encountered error while trying to install package.
      ╰─> numpy
      
      note: This is an issue with the package mentioned above, not pip.
      hint: See above for output from the failure.
...

Expected behaviour

Expected it to just install normally and resolve dependency conflicts as expected w/o clang error on macbook.

Steps To Reproduce

  1. Fresh python@3.8 from homebrew installed
  2. Fresh venv with appropriate version of pandas, scipy, numpy, etc installed accordingly (just went through requirements.txt manually and found the package version i needded - just the main ones
  3. pip(3) install ydata-quality

Solution

I'm able to finally install by doing the below commands partially grabbed from here (https://stackoverflow.com/questions/65825346/pip-install-pandas-results-in-error-python3-8-pycharm-apple-silicon)

$ brew install python@3.9
$ brew install openblas
$ OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install cython --no-use-pep517
$ OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install numpy --no-use-pep517
$ OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install pandas --no-use-pep517
$ OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install pybind11 --no-use-pep517
$ OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install scipy --no-use-pep517
$ brew install libjpeg zlib
$ python3 -m pip install pillow
$ python3 -m pip install matplotlib

Then I finally run this and installed successfully:

OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install ydata-quality --no-use-pep517

EDIT: Afterwards the numpy version was weird so I ran this and all good (just gottadeal with mismatching pkg messages)
pip install --upgrade numpy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions