2

I'm trying to install Apache Flink with either python3 -m pip install apache-flink or pip3 install apache-flink, but both fail with an exit code 1 error:

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 -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -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-10.14-arm64-3.8/numpy/core/src/umath -Ibuild/src.macosx-10.14-arm64-3.8/numpy/core/src/npymath -Ibuild/src.macosx-10.14-arm64-3.8/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-10.14-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/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -Ibuild/src.macosx-10.14-arm64-3.8/numpy/core/src/common -Ibuild/src.macosx-10.14-arm64-3.8/numpy/core/src/npymath -Ibuild/src.macosx-10.14-arm64-3.8/numpy/core/src/common -Ibuild/src.macosx-10.14-arm64-3.8/numpy/core/src/npymath -c numpy/core/src/multiarray/alloc.c -o build/temp.macosx-10.14-arm64-3.8/numpy/core/src/multiarray/alloc.o -MMD -MF build/temp.macosx-10.14-arm64-3.8/numpy/core/src/multiarray/alloc.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.

The output is quite long so I won't post the whole thing here, but if there's something in particular I should be looking for in there, any suggestions are welcome.

I've also tried starting with numpy already installed in a hope that apache-flink would just use the installed version but that didn't help.

pip3 --version -> pip 22.1.2 from /Users/sophier/Library/Python/3.8/lib/python/site-packages/pip (python 3.8)

I'm on the new mac with the M1 chip incase that could be a problem.

sozza594
  • 45
  • 4

1 Answers1

4

PyFlink on a M1 is not yet supported but will be from Flink 1.16 onwards, see https://issues.apache.org/jira/browse/FLINK-25188

Martijn Visser
  • 1,468
  • 1
  • 3
  • 9
  • I still have a similar issue with apache-flink 1.16 with poetry because of numpy version incompatibility between pemja requirement and apache-flink requirement on numpy -> ``` Because pemja (0.2.6) depends on numpy (1.21.4) and apache-flink (1.16.0) depends on numpy (>=1.14.3,<1.20), pemja (0.2.6) is incompatible with apache-flink (1.16.0).``` – Thomas Nov 18 '22 at 15:08
  • 1
    That Poetry problem will be improved with Flink 1.16.1, see https://issues.apache.org/jira/browse/FLINK-29817 – Martijn Visser Nov 22 '22 at 10:46
  • Any chance to know a release date? Or to have a clue on this? Thanks – Thomas Nov 26 '22 at 10:15
  • 1
    I would suspect in the next couple of weeks, probably at the end of this year/beginning of next year. – Martijn Visser Nov 28 '22 at 12:27
  • Thanks @MartijnVisser. Do you know if there is another way to run PyFlink on M1 while waiting? And do you know what the next Flink release is going to be 1.16.1 or 1.17.0? – Sami Badawi Dec 06 '22 at 16:38
  • Any update on this? I am unable to run pyflink on M1. Is there any alternative method? – Kshitij Bhadage Jan 05 '23 at 07:08
  • The discussion on Flink 1.16.1 has been started, I expect that will be released at the end of this month – Martijn Visser Jan 07 '23 at 07:31
  • 1
    Flink 1.16.1 is now available – Martijn Visser Jan 31 '23 at 12:12
  • Thank you @MartijnVisser I am trying to work with Flink 1.16.1. Do you by any chance have any Dockerfile examples with a Flink 1.16.1 image that also contain some RUN commands regarding installing python in the container? Like RUN apt install -y python3.8 python3-pip python3.8-dev? I believe python <3.10 is required for pyflink? – midav Feb 02 '23 at 17:38
  • Interesting, installing apache-flink==1.15.4 with Python3.7 works for me on M1. – Timo May 03 '23 at 13:18