pip install tensorflow failed due to grpcio

197 views Asked by At

I tried to install tensorflow on my local by running pip install tensorflow, and getting following error.

  cc1: warning: command line option '-std=c++14' is valid for C++/ObjC++ but not for C
  creating None
  creating None/tmp
  creating None/tmp/tmpzezg1qs3
  /home/gooder/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -fPIC -I/home/gooder/anaconda3/include/python3.7m -c /tmp/tmpzezg1qs3/a.c -o None/tmp/tmpzezg1qs3/a.o
  Traceback (most recent call last):
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/unixccompiler.py", line 186, in _compile
      self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
    File "/tmp/pip-install-19mjkv2x/grpcio/src/python/grpcio/_spawn_patch.py", line 54, in _commandfile_spawn
      _classic_spawn(self, command)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/ccompiler.py", line 1007, in spawn
      spawn(cmd, dry_run=self.dry_run, **kwargs)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/spawn.py", line 71, in spawn
      "command {!r} failed with exit code {}".format(cmd, exitcode)
  distutils.errors.DistutilsExecError: command '/home/gooder/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc' failed with exit code 1

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/tmp/pip-install-19mjkv2x/grpcio/src/python/grpcio/commands.py", line 280, in build_extensions
      build_ext.build_ext.build_extensions(self)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 194, in build_extensions
      self.build_extension(ext)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 246, in build_extension
      _build_ext.build_extension(self, ext)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/command/build_ext.py", line 554, in build_extension
      depends=ext.depends,
    File "/tmp/pip-install-19mjkv2x/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 59, in _parallel_compile
      _compile_single_file, objects)
    File "/home/gooder/anaconda3/lib/python3.7/multiprocessing/pool.py", line 268, in map
      return self._map_async(func, iterable, mapstar, chunksize).get()
    File "/home/gooder/anaconda3/lib/python3.7/multiprocessing/pool.py", line 657, in get
      raise self._value
    File "/home/gooder/anaconda3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
      result = (True, func(*args, **kwds))
    File "/home/gooder/anaconda3/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
      return list(map(*args))
    File "/tmp/pip-install-19mjkv2x/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 54, in _compile_single_file
      self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/unixccompiler.py", line 188, in _compile
      raise CompileError(msg)
  distutils.errors.CompileError: command '/home/gooder/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc' failed with exit code1

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-19mjkv2x/grpcio/setup.py", line 558, in <module>
      cmdclass=COMMAND_CLASS,
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
      self.run_command(cmd)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/dist.py", line 1217, in run_command
      super().run_command(command)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
      cmd_obj.run()
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 325, in run
      self.run_command("build")
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
      self.distribution.run_command(command)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/dist.py", line 1217, in run_command
      super().run_command(command)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
      cmd_obj.run()
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/command/build.py", line 132, in run
      self.run_command(cmd_name)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
      self.distribution.run_command(command)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/dist.py", line 1217, in run_command
      super().run_command(command)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
      cmd_obj.run()
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 84, in run
      _build_ext.run(self)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
      _build_ext.build_ext.run(self)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
      self.build_extensions()
    File "/tmp/pip-install-19mjkv2x/grpcio/src/python/grpcio/commands.py", line 285, in build_extensions
      "Failed `build_ext` step:\n{}".format(formatted_exception))
  commands.CommandError: Failed `build_ext` step:
  Traceback (most recent call last):
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/unixccompiler.py", line 186, in _compile
      self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
    File "/tmp/pip-install-19mjkv2x/grpcio/src/python/grpcio/_spawn_patch.py", line 54, in _commandfile_spawn
      _classic_spawn(self, command)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/ccompiler.py", line 1007, in spawn
      spawn(cmd, dry_run=self.dry_run, **kwargs)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/spawn.py", line 71, in spawn
      "command {!r} failed with exit code {}".format(cmd, exitcode)
  distutils.errors.DistutilsExecError: command '/home/gooder/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc' failed with exit code 1

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/tmp/pip-install-19mjkv2x/grpcio/src/python/grpcio/commands.py", line 280, in build_extensions
      build_ext.build_ext.build_extensions(self)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 194, in build_extensions
      self.build_extension(ext)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 246, in build_extension
      _build_ext.build_extension(self, ext)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/command/build_ext.py", line 554, in build_extension
      depends=ext.depends,
    File "/tmp/pip-install-19mjkv2x/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 59, in _parallel_compile
      _compile_single_file, objects)
    File "/home/gooder/anaconda3/lib/python3.7/multiprocessing/pool.py", line 268, in map
      return self._map_async(func, iterable, mapstar, chunksize).get()
    File "/home/gooder/anaconda3/lib/python3.7/multiprocessing/pool.py", line 657, in get
      raise self._value
    File "/home/gooder/anaconda3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
      result = (True, func(*args, **kwds))
    File "/home/gooder/anaconda3/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
      return list(map(*args))
    File "/tmp/pip-install-19mjkv2x/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 54, in _compile_single_file
      self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
    File "/home/gooder/anaconda3/lib/python3.7/site-packages/setuptools/_distutils/unixccompiler.py", line 188, in _compile
      raise CompileError(msg)
  distutils.errors.CompileError: command '/home/gooder/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc' failed with exit code1

  ----------------------------------------
  ERROR: Failed building wheel for grpcio

I have updated my pip version and setup tool version, but still getting the same thing. I also tried using virtual env but still cannot install this. I'm using ubuntu 18.04. Does anyone know what's going on here?

0

There are 0 answers