beyretb / AnimalAI-Olympics

Code repository for the Animal AI Olympics competition
Apache License 2.0
573 stars 84 forks source link

Building grpcio wheel fails on macos #67

Closed ryanjmccall closed 5 years ago

ryanjmccall commented 5 years ago

I cannot install this package on macos. Building grpcio fails. I did some digging and found this project solved the problem (https://github.com/jeongyoonlee/Kaggler/blob/master/setup.py) by passing compile args. Relevant SO threads: https://stackoverflow.com/questions/52460913/compiling-cython-with-xcode-10/52466939 and https://stackoverflow.com/questions/1676384/how-to-pass-flag-to-gcc-in-python-setup-py-script

I tried hacking animal's setup.py with no success. Here's the error I'm hitting

Building wheels for collected packages: grpcio Running setup.py bdist_wheel for grpcio ... error Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T/pip-install-v_y2xwtl/grpcio/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /private/var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T/pip-wheel-q8xajt41 --python-tag cp37: Found cython-generated files... running bdist_wheel running build running build_py running build_project_metadata creating python_build creating python_build/lib.macosx-10.7-x86_64-3.7 creating python_build/lib.macosx-10.7-x86_64-3.7/grpc copying src/python/grpcio/grpc/_channel.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc copying src/python/grpcio/grpc/_common.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc copying src/python/grpcio/grpc/init.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc copying src/python/grpcio/grpc/_utilities.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc copying src/python/grpcio/grpc/_plugin_wrapping.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc copying src/python/grpcio/grpc/_interceptor.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc copying src/python/grpcio/grpc/_grpcio_metadata.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc copying src/python/grpcio/grpc/_server.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc copying src/python/grpcio/grpc/_auth.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc creating python_build/lib.macosx-10.7-x86_64-3.7/grpc/beta copying src/python/grpcio/grpc/beta/_server_adaptations.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/beta copying src/python/grpcio/grpc/beta/interfaces.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/beta copying src/python/grpcio/grpc/beta/_metadata.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/beta copying src/python/grpcio/grpc/beta/init.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/beta copying src/python/grpcio/grpc/beta/utilities.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/beta copying src/python/grpcio/grpc/beta/implementations.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/beta copying src/python/grpcio/grpc/beta/_client_adaptations.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/beta creating python_build/lib.macosx-10.7-x86_64-3.7/grpc/experimental copying src/python/grpcio/grpc/experimental/gevent.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/experimental copying src/python/grpcio/grpc/experimental/init.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/experimental creating python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework copying src/python/grpcio/grpc/framework/init.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework creating python_build/lib.macosx-10.7-x86_64-3.7/grpc/_cython copying src/python/grpcio/grpc/_cython/init.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/_cython creating python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/foundation copying src/python/grpcio/grpc/framework/foundation/callable_util.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/foundation copying src/python/grpcio/grpc/framework/foundation/abandonment.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/foundation copying src/python/grpcio/grpc/framework/foundation/init.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/foundation copying src/python/grpcio/grpc/framework/foundation/stream.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/foundation copying src/python/grpcio/grpc/framework/foundation/stream_util.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/foundation copying src/python/grpcio/grpc/framework/foundation/future.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/foundation copying src/python/grpcio/grpc/framework/foundation/logging_pool.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/foundation creating python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/common copying src/python/grpcio/grpc/framework/common/style.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/common copying src/python/grpcio/grpc/framework/common/cardinality.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/common copying src/python/grpcio/grpc/framework/common/init.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/common creating python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/interfaces copying src/python/grpcio/grpc/framework/interfaces/init.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/interfaces creating python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/interfaces/face copying src/python/grpcio/grpc/framework/interfaces/face/init.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/interfaces/face copying src/python/grpcio/grpc/framework/interfaces/face/utilities.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/interfaces/face copying src/python/grpcio/grpc/framework/interfaces/face/face.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/interfaces/face creating python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/interfaces/base copying src/python/grpcio/grpc/framework/interfaces/base/init.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/interfaces/base copying src/python/grpcio/grpc/framework/interfaces/base/utilities.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/interfaces/base copying src/python/grpcio/grpc/framework/interfaces/base/base.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/framework/interfaces/base creating python_build/lib.macosx-10.7-x86_64-3.7/grpc/_cython/_cygrpc copying src/python/grpcio/grpc/_cython/_cygrpc/init.py -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/_cython/_cygrpc creating python_build/lib.macosx-10.7-x86_64-3.7/grpc/_cython/_credentials copying src/python/grpcio/grpc/_cython/_credentials/roots.pem -> python_build/lib.macosx-10.7-x86_64-3.7/grpc/_cython/_credentials running build_ext b'make: Circular /private/var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T/pip-install-v_y2xwtl/grpcio/libs/opt/libaddress_sorting.a <- /private/var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T/pip-install-v_y2xwtl/grpcio/libs/opt/libares.a dependency dropped.\n' Found cython-generated files... building 'grpc._cython.cygrpc' extension creating python_build/temp.macosx-10.7-x86_64-3.7 creating python_build/temp.macosx-10.7-x86_64-3.7/src creating python_build/temp.macosx-10.7-x86_64-3.7/src/python creating python_build/temp.macosx-10.7-x86_64-3.7/src/python/grpcio creating python_build/temp.macosx-10.7-x86_64-3.7/src/python/grpcio/grpc creating python_build/temp.macosx-10.7-x86_64-3.7/src/python/grpcio/grpc/_cython gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -I/anaconda3/include -arch x86_64 -DOPENSSL_NO_ASM=1 -D_WIN32_WINNT=1536 -DGPR_BACKWARDS_COMPATIBILITY_MODE=1 -DHAVE_CONFIG_H=1 -DGRPC_ENABLE_FORK_SUPPORT=1 -DPyMODINIT_FUNC=extern "C" attribute((visibility ("default"))) PyObject* -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1 -Isrc/python/grpcio -Iinclude -I. -Ithird_party/boringssl/include -Ithird_party/zlib -Ithird_party/cares -Ithird_party/cares/cares -Ithird_party/cares/config_darwin -Ithird_party/address_sorting/include -I/anaconda3/include/python3.7m -c src/python/grpcio/grpc/_cython/cygrpc.cpp -o python_build/temp.macosx-10.7-x86_64-3.7/src/python/grpcio/grpc/_cython/cygrpc.o -std=c++11 -fvisibility=hidden -fno-wrapv -fno-exceptions -DPB_FIELD_16BIT -pthread warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found] > src/python/grpcio/grpc/_cython/cygrpc.cpp:1343:14: fatal error: 'cstdlib' file not found

include

           ^~~~~~~~~

1 warning and 1 error generated. creating var creating var/folders creating var/folders/39 creating var/folders/39/glh0vc5x3qq23jgtd82s68200000gn creating var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T creating var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T/tmpwp44atj9 gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -I/anaconda3/include -arch x86_64 -I/anaconda3/include/python3.7m -c /var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T/tmpwp44atj9/a.c -o var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T/tmpwp44atj9/a.o Traceback (most recent call last): File "/anaconda3/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile extra_postargs) File "/private/var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T/pip-install-v_y2xwtl/grpcio/src/python/grpcio/_spawn_patch.py", line 54, in _commandfile_spawn _classic_spawn(self, command) File "/anaconda3/lib/python3.7/distutils/ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "/anaconda3/lib/python3.7/distutils/spawn.py", line 36, in spawn _spawn_posix(cmd, search_path, dry_run=dry_run) File "/anaconda3/lib/python3.7/distutils/spawn.py", line 159, in _spawn_posix % (cmd, exit_status)) distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/private/var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T/pip-install-v_y2xwtl/grpcio/src/python/grpcio/commands.py", line 292, in build_extensions build_ext.build_ext.build_extensions(self) File "/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 194, in build_extensions self.build_extension(ext) File "/anaconda3/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 205, in build_extension _build_ext.build_extension(self, ext) File "/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 533, in build_extension depends=ext.depends) File "/anaconda3/lib/python3.7/distutils/ccompiler.py", line 574, in compile self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) File "/anaconda3/lib/python3.7/distutils/unixccompiler.py", line 120, in _compile raise CompileError(msg) distutils.errors.CompileError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/private/var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T/pip-install-v_y2xwtl/grpcio/setup.py", line 313, in cmdclass=COMMAND_CLASS, File "/anaconda3/lib/python3.7/site-packages/setuptools/init.py", line 145, in setup return distutils.core.setup(**attrs) File "/anaconda3/lib/python3.7/distutils/core.py", line 148, in setup dist.run_commands() File "/anaconda3/lib/python3.7/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/home/.local/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run self.run_command('build') File "/anaconda3/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/anaconda3/lib/python3.7/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/anaconda3/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/anaconda3/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 84, in run _build_ext.run(self) File "/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run _build_ext.build_ext.run(self) File "/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 339, in run self.build_extensions() File "/private/var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T/pip-install-v_y2xwtl/grpcio/src/python/grpcio/commands.py", line 297, in build_extensions "Failed build_ext step:\n{}".format(formatted_exception)) commands.CommandError: Failed build_ext step: Traceback (most recent call last): File "/anaconda3/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile extra_postargs) File "/private/var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T/pip-install-v_y2xwtl/grpcio/src/python/grpcio/_spawn_patch.py", line 54, in _commandfile_spawn _classic_spawn(self, command) File "/anaconda3/lib/python3.7/distutils/ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "/anaconda3/lib/python3.7/distutils/spawn.py", line 36, in spawn _spawn_posix(cmd, search_path, dry_run=dry_run) File "/anaconda3/lib/python3.7/distutils/spawn.py", line 159, in _spawn_posix % (cmd, exit_status)) distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/private/var/folders/39/glh0vc5x3qq23jgtd82s68200000gn/T/pip-install-v_y2xwtl/grpcio/src/python/grpcio/commands.py", line 292, in build_extensions build_ext.build_ext.build_extensions(self) File "/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 194, in build_extensions self.build_extension(ext) File "/anaconda3/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 205, in build_extension _build_ext.build_extension(self, ext) File "/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 533, in build_extension depends=ext.depends) File "/anaconda3/lib/python3.7/distutils/ccompiler.py", line 574, in compile self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) File "/anaconda3/lib/python3.7/distutils/unixccompiler.py", line 120, in _compile raise CompileError(msg) distutils.errors.CompileError: command 'gcc' failed with exit status 1


Failed building wheel for grpcio Running setup.py clean for grpcio Failed to build grpcio

beyretb commented 5 years ago

Hello,

From your error message I see that you're using python 3.7 which we do not support at the moment, can you try setting up a virtual environment or a conda one with python 3.6 and try to reinstall?

From our tests, both the animalai and animalai-train packages work on MacOS with python3.6.

beyretb commented 5 years ago

closing due to inactivity, please reopen if needed