Grpc: [Python install] "Failed building wheel for grpcio" when installing on Raspberry Pi Zero W

Created on 28 Jan 2019  Â·  3Comments  Â·  Source: grpc/grpc

What version of gRPC and what language are you using?

The dependency included when firebase-admin.

What operating system (Linux, Windows, …) and version?

Raspbian GNU/Linux 9 (stretch)

What runtime / compiler are you using (e.g. python version or version of gcc)

Python 2.7

What did you do?

If possible, provide a recipe for reproducing the error. Try being specific and include code snippets if helpful.

Running sudo pip install firebase-admin

What did you expect to see?

Successful install of Firebase.

What did you see instead?

Following error:

Building wheels for collected packages: grpcio
  Building wheel for grpcio (setup.py) ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-I44EVu/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 /tmp/pip-wheel-gdrdPY --python-tag cp27:
  Found cython-generated files...
  running bdist_wheel
  running build
  running build_py
  running build_project_metadata
  creating python_build
  creating python_build/lib.linux-armv6l-2.7
  creating python_build/lib.linux-armv6l-2.7/grpc
  copying src/python/grpcio/grpc/_channel.py -> python_build/lib.linux-armv6l-2.7/grpc
  copying src/python/grpcio/grpc/_interceptor.py -> python_build/lib.linux-armv6l-2.7/grpc
  copying src/python/grpcio/grpc/_common.py -> python_build/lib.linux-armv6l-2.7/grpc
  copying src/python/grpcio/grpc/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc
  copying src/python/grpcio/grpc/_grpcio_metadata.py -> python_build/lib.linux-armv6l-2.7/grpc
  copying src/python/grpcio/grpc/_auth.py -> python_build/lib.linux-armv6l-2.7/grpc
  copying src/python/grpcio/grpc/_server.py -> python_build/lib.linux-armv6l-2.7/grpc
  copying src/python/grpcio/grpc/_utilities.py -> python_build/lib.linux-armv6l-2.7/grpc
  copying src/python/grpcio/grpc/_plugin_wrapping.py -> python_build/lib.linux-armv6l-2.7/grpc
  creating python_build/lib.linux-armv6l-2.7/grpc/_cython
  copying src/python/grpcio/grpc/_cython/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/_cython
  creating python_build/lib.linux-armv6l-2.7/grpc/experimental
  copying src/python/grpcio/grpc/experimental/gevent.py -> python_build/lib.linux-armv6l-2.7/grpc/experimental
  copying src/python/grpcio/grpc/experimental/session_cache.py -> python_build/lib.linux-armv6l-2.7/grpc/experimental
  copying src/python/grpcio/grpc/experimental/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/experimental
  creating python_build/lib.linux-armv6l-2.7/grpc/beta
  copying src/python/grpcio/grpc/beta/interfaces.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
  copying src/python/grpcio/grpc/beta/_metadata.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
  copying src/python/grpcio/grpc/beta/utilities.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
  copying src/python/grpcio/grpc/beta/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
  copying src/python/grpcio/grpc/beta/implementations.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
  copying src/python/grpcio/grpc/beta/_server_adaptations.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
  copying src/python/grpcio/grpc/beta/_client_adaptations.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
  creating python_build/lib.linux-armv6l-2.7/grpc/framework
  copying src/python/grpcio/grpc/framework/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/framework
  creating python_build/lib.linux-armv6l-2.7/grpc/_cython/_cygrpc
  copying src/python/grpcio/grpc/_cython/_cygrpc/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/_cython/_cygrpc
  creating python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces
  copying src/python/grpcio/grpc/framework/interfaces/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces
  creating python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
  copying src/python/grpcio/grpc/framework/foundation/stream.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
  copying src/python/grpcio/grpc/framework/foundation/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
  copying src/python/grpcio/grpc/framework/foundation/callable_util.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
  copying src/python/grpcio/grpc/framework/foundation/future.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
  copying src/python/grpcio/grpc/framework/foundation/logging_pool.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
  copying src/python/grpcio/grpc/framework/foundation/stream_util.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
  copying src/python/grpcio/grpc/framework/foundation/abandonment.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
  creating python_build/lib.linux-armv6l-2.7/grpc/framework/common
  copying src/python/grpcio/grpc/framework/common/style.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/common
  copying src/python/grpcio/grpc/framework/common/cardinality.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/common
  copying src/python/grpcio/grpc/framework/common/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/common
  creating python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/face
  copying src/python/grpcio/grpc/framework/interfaces/face/face.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/face
  copying src/python/grpcio/grpc/framework/interfaces/face/utilities.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/face
  copying src/python/grpcio/grpc/framework/interfaces/face/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/face
  creating python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/base
  copying src/python/grpcio/grpc/framework/interfaces/base/utilities.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/base
  copying src/python/grpcio/grpc/framework/interfaces/base/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/base
  copying src/python/grpcio/grpc/framework/interfaces/base/base.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/base
  creating python_build/lib.linux-armv6l-2.7/grpc/_cython/_credentials
  copying src/python/grpcio/grpc/_cython/_credentials/roots.pem -> python_build/lib.linux-armv6l-2.7/grpc/_cython/_credentials
  running build_ext
  Found cython-generated files...
  building 'grpc._cython.cygrpc' extension
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-I44EVu/grpcio/setup.py", line 369, in <module>
      cmdclass=COMMAND_CLASS,
    File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
      dist.run_commands()
    File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python2.7/dist-packages/wheel/bdist_wheel.py", line 188, in run
      self.run_command('build')
    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
      self.run_command(cmd_name)
    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_ext.py", line 78, in run
      _build_ext.run(self)
    File "/usr/local/lib/python2.7/dist-packages/Cython/Distutils/old_build_ext.py", line 186, in run
      _build_ext.build_ext.run(self)
    File "/usr/lib/python2.7/distutils/command/build_ext.py", line 340, in run
      self.build_extensions()
    File "/tmp/pip-install-I44EVu/grpcio/src/python/grpcio/commands.py", line 275, in build_extensions
      support.diagnose_build_ext_error(self, error, formatted_exception)
    File "/tmp/pip-install-I44EVu/grpcio/src/python/grpcio/support.py", line 109, in diagnose_build_ext_error
      "backtrace).\n\n{}".format(formatted))
  commands.CommandError:

  We could not diagnose your build failure. If you are unable to proceed, please file an issue at http://www.github.com/grpc/grpc with `[Python install]` in the title; please attach the whole log (including everything that may have appeared above the Python backtrace).

  Traceback (most recent call last):
    File "/tmp/pip-install-I44EVu/grpcio/src/python/grpcio/commands.py", line 272, in build_extensions
      build_ext.build_ext.build_extensions(self)
    File "/usr/local/lib/python2.7/dist-packages/Cython/Distutils/old_build_ext.py", line 194, in build_extensions
      self.build_extension(ext)
    File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_ext.py", line 199, in build_extension
      _build_ext.build_extension(self, ext)
    File "/usr/lib/python2.7/distutils/command/build_ext.py", line 499, in build_extension
      depends=ext.depends)
    File "/usr/lib/python2.7/distutils/ccompiler.py", line 566, in compile
      depends, extra_postargs)
    File "/usr/lib/python2.7/distutils/ccompiler.py", line 329, in _setup_compile
      raise TypeError, "'output_dir' must be a string or None"
  TypeError: 'output_dir' must be a string or None


  ----------------------------------------
  Failed building wheel for grpcio
  Running setup.py clean for grpcio
Failed to build grpcio
Installing collected packages: grpcio, google-api-core, msgpack, cachecontrol, google-cloud-core, google-cloud-firestore, google-resumable-media, google-cloud-storage, firebase-admin
  Running setup.py install for grpcio ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-I44EVu/grpcio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-mHSou9/install-record.txt --single-version-externally-managed --compile:
    Found cython-generated files...
    running install
    running build
    running build_py
    running build_project_metadata
    creating python_build
    creating python_build/lib.linux-armv6l-2.7
    creating python_build/lib.linux-armv6l-2.7/grpc
    copying src/python/grpcio/grpc/_channel.py -> python_build/lib.linux-armv6l-2.7/grpc
    copying src/python/grpcio/grpc/_interceptor.py -> python_build/lib.linux-armv6l-2.7/grpc
    copying src/python/grpcio/grpc/_common.py -> python_build/lib.linux-armv6l-2.7/grpc
    copying src/python/grpcio/grpc/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc
    copying src/python/grpcio/grpc/_grpcio_metadata.py -> python_build/lib.linux-armv6l-2.7/grpc
    copying src/python/grpcio/grpc/_auth.py -> python_build/lib.linux-armv6l-2.7/grpc
    copying src/python/grpcio/grpc/_server.py -> python_build/lib.linux-armv6l-2.7/grpc
    copying src/python/grpcio/grpc/_utilities.py -> python_build/lib.linux-armv6l-2.7/grpc
    copying src/python/grpcio/grpc/_plugin_wrapping.py -> python_build/lib.linux-armv6l-2.7/grpc
    creating python_build/lib.linux-armv6l-2.7/grpc/_cython
    copying src/python/grpcio/grpc/_cython/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/_cython
    creating python_build/lib.linux-armv6l-2.7/grpc/experimental
    copying src/python/grpcio/grpc/experimental/gevent.py -> python_build/lib.linux-armv6l-2.7/grpc/experimental
    copying src/python/grpcio/grpc/experimental/session_cache.py -> python_build/lib.linux-armv6l-2.7/grpc/experimental
    copying src/python/grpcio/grpc/experimental/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/experimental
    creating python_build/lib.linux-armv6l-2.7/grpc/beta
    copying src/python/grpcio/grpc/beta/interfaces.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
    copying src/python/grpcio/grpc/beta/_metadata.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
    copying src/python/grpcio/grpc/beta/utilities.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
    copying src/python/grpcio/grpc/beta/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
    copying src/python/grpcio/grpc/beta/implementations.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
    copying src/python/grpcio/grpc/beta/_server_adaptations.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
    copying src/python/grpcio/grpc/beta/_client_adaptations.py -> python_build/lib.linux-armv6l-2.7/grpc/beta
    creating python_build/lib.linux-armv6l-2.7/grpc/framework
    copying src/python/grpcio/grpc/framework/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/framework
    creating python_build/lib.linux-armv6l-2.7/grpc/_cython/_cygrpc
    copying src/python/grpcio/grpc/_cython/_cygrpc/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/_cython/_cygrpc
    creating python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces
    copying src/python/grpcio/grpc/framework/interfaces/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces
    creating python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
    copying src/python/grpcio/grpc/framework/foundation/stream.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
    copying src/python/grpcio/grpc/framework/foundation/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
    copying src/python/grpcio/grpc/framework/foundation/callable_util.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
    copying src/python/grpcio/grpc/framework/foundation/future.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
    copying src/python/grpcio/grpc/framework/foundation/logging_pool.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
    copying src/python/grpcio/grpc/framework/foundation/stream_util.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
    copying src/python/grpcio/grpc/framework/foundation/abandonment.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/foundation
    creating python_build/lib.linux-armv6l-2.7/grpc/framework/common
    copying src/python/grpcio/grpc/framework/common/style.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/common
    copying src/python/grpcio/grpc/framework/common/cardinality.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/common
    copying src/python/grpcio/grpc/framework/common/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/common
    creating python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/face
    copying src/python/grpcio/grpc/framework/interfaces/face/face.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/face
    copying src/python/grpcio/grpc/framework/interfaces/face/utilities.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/face
    copying src/python/grpcio/grpc/framework/interfaces/face/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/face
    creating python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/base
    copying src/python/grpcio/grpc/framework/interfaces/base/utilities.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/base
    copying src/python/grpcio/grpc/framework/interfaces/base/__init__.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/base
    copying src/python/grpcio/grpc/framework/interfaces/base/base.py -> python_build/lib.linux-armv6l-2.7/grpc/framework/interfaces/base
    creating python_build/lib.linux-armv6l-2.7/grpc/_cython/_credentials
    copying src/python/grpcio/grpc/_cython/_credentials/roots.pem -> python_build/lib.linux-armv6l-2.7/grpc/_cython/_credentials
    running build_ext
    Found cython-generated files...
    building 'grpc._cython.cygrpc' extension
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-I44EVu/grpcio/setup.py", line 369, in <module>
        cmdclass=COMMAND_CLASS,
      File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
        self.run_command('build')
      File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
        self.run_command(cmd_name)
      File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_ext.py", line 78, in run
        _build_ext.run(self)
      File "/usr/local/lib/python2.7/dist-packages/Cython/Distutils/old_build_ext.py", line 186, in run
        _build_ext.build_ext.run(self)
      File "/usr/lib/python2.7/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/tmp/pip-install-I44EVu/grpcio/src/python/grpcio/commands.py", line 275, in build_extensions
        support.diagnose_build_ext_error(self, error, formatted_exception)
      File "/tmp/pip-install-I44EVu/grpcio/src/python/grpcio/support.py", line 109, in diagnose_build_ext_error
        "backtrace).\n\n{}".format(formatted))
    commands.CommandError:

    We could not diagnose your build failure. If you are unable to proceed, please file an issue at http://www.github.com/grpc/grpc with `[Python install]` in the title; please attach the whole log (including everything that may have appeared above the Python backtrace).

    Traceback (most recent call last):
      File "/tmp/pip-install-I44EVu/grpcio/src/python/grpcio/commands.py", line 272, in build_extensions
        build_ext.build_ext.build_extensions(self)
      File "/usr/local/lib/python2.7/dist-packages/Cython/Distutils/old_build_ext.py", line 194, in build_extensions
        self.build_extension(ext)
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_ext.py", line 199, in build_extension
        _build_ext.build_extension(self, ext)
      File "/usr/lib/python2.7/distutils/command/build_ext.py", line 499, in build_extension
        depends=ext.depends)
      File "/usr/lib/python2.7/distutils/ccompiler.py", line 566, in compile
        depends, extra_postargs)
      File "/usr/lib/python2.7/distutils/ccompiler.py", line 329, in _setup_compile
        raise TypeError, "'output_dir' must be a string or None"
    TypeError: 'output_dir' must be a string or None


    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-I44EVu/grpcio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-mHSou9/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-I44EVu/grpcio/

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

See https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md for how to diagnose problems better.

Anything else we should know about your project / environment?

Running this on a Raspberry Pi Zero W. Have an identical piece of hardware that installed firebase-admin module without issue.

kinbug lanPython prioritP2

Most helpful comment

Setuptools 40.7.1 pulls in this fix. Upgrading to it should correct the issue.

@charliesneath Can you confirm that this resolves the issue for you?

All 3 comments

This appears to be related to a breaking change in setuptools. This will affect anyone who has pulled in setuptools 40.7.0 and is building from source. A reversion is currently in the works on their end. In the meantime, using an older version of setuptools is a viable option.

Setuptools 40.7.1 pulls in this fix. Upgrading to it should correct the issue.

@charliesneath Can you confirm that this resolves the issue for you?

@gnossen Can confirm that this fixed the issue. I was able to successfully run sudo pip install firebase-admin after updating setuptools with python -m pip install --upgrade setuptools. Thank you!

Was this page helpful?
0 / 5 - 0 ratings