ROCm / ROCm-docker

Dockerfiles for the various software layers defined in the ROCm software platform
MIT License
432 stars 65 forks source link

Problem installing tensorflow-rocm #82

Closed supermar1010 closed 1 year ago

supermar1010 commented 3 years ago

Hello, when trying to install tensorflow-rocm, I get this error:

Any idea how to solve this? I tried installing python-dev but apt-get does not find it.

    cc1plus: warning: command line option '-std=gnu99' is valid for C/ObjC but not for C++
    creating None
    creating None/tmp
    creating None/tmp/tmps86601ng
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c /tmp/tmps86601ng/a.c -o None/tmp/tmps86601ng/a.o
    /tmp/tmps86601ng/a.c:2:10: fatal error: Python.h: No such file or directory
     #include <Python.h>
              ^~~~~~~~~~
    compilation terminated.

    Could not find <Python.h>. This could mean the following:
      * You're on Ubuntu and haven't run `apt-get install python3-dev`.
      * You're on RHEL/Fedora and haven't run `yum install python3-devel` or
        `dnf install python3-devel` (make sure you also have redhat-rpm-config
        installed)
      * You're on Mac OS X and the usual Python framework was somehow corrupted
        (check your environment variables or try re-installing?)
      * You're on Windows and your Python installation was somehow corrupted
        (check your environment variables or try re-installing?)
    Traceback (most recent call last):
      File "/usr/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
        extra_postargs)
      File "/tmp/pip-build-qtkh5po1/grpcio/src/python/grpcio/_spawn_patch.py", line 54, in _commandfile_spawn
        _classic_spawn(self, command)
      File "/usr/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
        spawn(cmd, dry_run=self.dry_run)
      File "/usr/lib/python3.6/distutils/spawn.py", line 36, in spawn
        _spawn_posix(cmd, search_path, dry_run=dry_run)
      File "/usr/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
        % (cmd, exit_status))
    distutils.errors.DistutilsExecError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/tmp/pip-build-qtkh5po1/grpcio/src/python/grpcio/commands.py", line 286, in build_extensions
        build_ext.build_ext.build_extensions(self)
      File "/usr/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
        self._build_extensions_serial()
      File "/usr/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
        self.build_extension(ext)
      File "/home/rocm-user/.local/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 196, in build_extension
        _build_ext.build_extension(self, ext)
      File "/usr/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
        depends=ext.depends)
      File "/tmp/pip-build-qtkh5po1/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 59, in _parallel_compile
        _compile_single_file, objects)
      File "/usr/lib/python3.6/multiprocessing/pool.py", line 266, in map
        return self._map_async(func, iterable, mapstar, chunksize).get()
      File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
        raise self._value
      File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
        result = (True, func(*args, **kwds))
      File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
        return list(map(*args))
      File "/tmp/pip-build-qtkh5po1/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 "/usr/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
        raise CompileError(msg)
    distutils.errors.CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-qtkh5po1/grpcio/setup.py", line 525, in <module>
        cmdclass=COMMAND_CLASS,
      File "/home/rocm-user/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/rocm-user/.local/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python3.6/distutils/command/install.py", line 589, in run
        self.run_command('build')
      File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/rocm-user/.local/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 79, in run
        _build_ext.run(self)
      File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
        self.build_extensions()
      File "/tmp/pip-build-qtkh5po1/grpcio/src/python/grpcio/commands.py", line 289, in build_extensions
        support.diagnose_build_ext_error(self, error, formatted_exception)
      File "/tmp/pip-build-qtkh5po1/grpcio/src/python/grpcio/support.py", line 118, in diagnose_build_ext_error
        diagnostic(build_ext, error)
      File "/tmp/pip-build-qtkh5po1/grpcio/src/python/grpcio/support.py", line 77, in diagnose_compile_error
        _expect_compile(build_ext.compiler, c_check, message)
      File "/tmp/pip-build-qtkh5po1/grpcio/src/python/grpcio/support.py", line 71, in _expect_compile
        error_message))
    commands.CommandError: Diagnostics found a compilation environment issue:

    Could not find <Python.h>. This could mean the following:
      * You're on Ubuntu and haven't run `apt-get install python3-dev`.
      * You're on RHEL/Fedora and haven't run `yum install python3-devel` or
        `dnf install python3-devel` (make sure you also have redhat-rpm-config
        installed)
      * You're on Mac OS X and the usual Python framework was somehow corrupted
        (check your environment variables or try re-installing?)
      * You're on Windows and your Python installation was somehow corrupted
        (check your environment variables or try re-installing?)

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qtkh5po1/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-f5thmc2l-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-qtkh5po1/grpcio/