Issues installing TensorFlow-probability on CentOS 7

Hi,

I’m trying to install TensorFlow probability on a CentOS 7 machine. My Tensorflow (v 2.6) installation runs on virtual environment with Python 3.8. I have tried installing the package using pip3 install --upgrade tensorflow-probability but I’m getting an error that I don’t know how to address (see attached logs). Any help will be highly appreciated! Thanks!

Collecting tensorflow-probability
Using cached tensorflow_probability-0.19.0-py2.py3-none-any.whl (6.7 MB)
Requirement already satisfied: numpy>=1.13.3 in ./tf2.6.0/lib/python3.6/site-packages (from tensorflow-probability) (1.19.5)
Requirement already satisfied: absl-py in ./tf2.6.0/lib/python3.6/site-packages (from tensorflow-probability) (0.15.0)
Collecting decorator
Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Requirement already satisfied: six>=1.10.0 in ./tf2.6.0/lib/python3.6/site-packages (from tensorflow-probability) (1.15.0)
Collecting dm-tree
Using cached dm-tree-0.1.8.tar.gz (35 kB)
Preparing metadata (setup.py) … done
Collecting cloudpickle>=1.3
Using cached cloudpickle-2.2.1-py3-none-any.whl (25 kB)
Requirement already satisfied: gast>=0.3.2 in ./tf2.6.0/lib/python3.6/site-packages (from tensorflow-probability) (0.4.0)
Building wheels for collected packages: dm-tree
Building wheel for dm-tree (setup.py) … error
ERROR: Command errored out with exit status 1:
command: /home/Mousepet/tf2.6.0/bin/python3 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/setup.py’“'”‘; file=’“'”‘/tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/setup.py’“'”‘;f = getattr(tokenize, ‘"’“‘open’”’“‘, open)(file) if os.path.exists(file) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ bdist_wheel -d /tmp/pip-wheel-3sowv1z6
cwd: /tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/
Complete output (79 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/tree
copying tree/init.py → build/lib.linux-x86_64-3.6/tree
copying tree/sequence.py → build/lib.linux-x86_64-3.6/tree
copying tree/tree_benchmark.py → build/lib.linux-x86_64-3.6/tree
copying tree/tree_test.py → build/lib.linux-x86_64-3.6/tree
running build_ext
cmake version 3.12.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
Found CMake
– The CXX compiler identification is GNU 9.2.0
– Check for working CXX compiler: /usr/local/bin/c++
– Check for working CXX compiler: /usr/local/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Found Python3: /home/Mousepet/tf2.6.0/bin/python3 (found version “3.6.8”) found components: Interpreter Development
Current build type is: Release
PROJECT_BINARY_DIR is: /tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/build/temp.linux-x86_64-3.6
– pybind11 v2.10.1
– Performing Test HAS_FLTO
– Performing Test HAS_FLTO - Success
– Configuring done
– Generating done
– Build files have been written to: /tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/build/temp.linux-x86_64-3.6
Unknown argument -j16
Usage: cmake --build [options] [-- [native-options]]
Options:
= Project binary directory to be built.
-j [] --parallel [] = Build in parallel using
the given number of jobs. If is omitted
the native build tool’s default number is used.
The CMAKE_BUILD_PARALLEL_LEVEL environment variable
specifies a default parallel level when this option
is not given.
–target = Build instead of default targets.
May only be specified once.
–config = For multi-configuration tools, choose .
–clean-first = Build target ‘clean’ first, then build.
(To clean only, use --target ‘clean’.)
–use-stderr = Ignored. Behavior is default in CMake >= 3.0.
– = Pass remaining options to the native tool.
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/setup.py”, line 155, in
keywords=‘tree nest flatten’,
File “/home/Mousepet/tf2.6.0/lib64/python3.6/site-packages/setuptools/init.py”, line 153, in setup
return distutils.core.setup(**attrs)
File “/usr/lib64/python3.6/distutils/core.py”, line 148, in setup
dist.run_commands()
File “/usr/lib64/python3.6/distutils/dist.py”, line 955, in run_commands
self.run_command(cmd)
File “/usr/lib64/python3.6/distutils/dist.py”, line 974, in run_command
cmd_obj.run()
File “/home/Mousepet/tf2.6.0/lib64/python3.6/site-packages/wheel/bdist_wheel.py”, line 299, in run
self.run_command(‘build’)
File “/usr/lib64/python3.6/distutils/cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “/usr/lib64/python3.6/distutils/dist.py”, line 974, in run_command
cmd_obj.run()
File “/usr/lib64/python3.6/distutils/command/build.py”, line 135, in run
self.run_command(cmd_name)
File “/usr/lib64/python3.6/distutils/cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “/usr/lib64/python3.6/distutils/dist.py”, line 974, in run_command
cmd_obj.run()
File “/tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/setup.py”, line 72, in run
self.build_extension(ext)
File “/tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/setup.py”, line 112, in build_extension
cwd=self.build_temp)
File “/usr/lib64/python3.6/subprocess.py”, line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘–build’, ‘.’, ‘-j16’, ‘–config’, ‘Release’]’ returned non-zero exit status 1.

ERROR: Failed building wheel for dm-tree
Running setup.py clean for dm-tree
Failed to build dm-tree
Installing collected packages: dm-tree, decorator, cloudpickle, tensorflow-probability
Running setup.py install for dm-tree … error
ERROR: Command errored out with exit status 1:
command: /home/Mousepet/tf2.6.0/bin/python3 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/setup.py’“'”‘; file=’“'”‘/tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/setup.py’“'”‘;f = getattr(tokenize, ‘"’“‘open’”’“‘, open)(file) if os.path.exists(file) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ install --record /tmp/pip-record-3u617buw/install-record.txt --single-version-externally-managed --compile --install-headers /home/Mousepet/tf2.6.0/include/site/python3.6/dm-tree
cwd: /tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/
Complete output (83 lines):
running install
/home/Mousepet/tf2.6.0/lib64/python3.6/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/tree
copying tree/init.py → build/lib.linux-x86_64-3.6/tree
copying tree/sequence.py → build/lib.linux-x86_64-3.6/tree
copying tree/tree_benchmark.py → build/lib.linux-x86_64-3.6/tree
copying tree/tree_test.py → build/lib.linux-x86_64-3.6/tree
running build_ext
cmake version 3.12.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
Found CMake
-- The CXX compiler identification is GNU 9.2.0
-- Check for working CXX compiler: /usr/local/bin/c++
-- Check for working CXX compiler: /usr/local/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python3: /home/Mousepet/tf2.6.0/bin/python3 (found version "3.6.8") found components:  Interpreter Development
Current build type is: Release
PROJECT_BINARY_DIR is: /tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/build/temp.linux-x86_64-3.6
-- pybind11 v2.10.1
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/build/temp.linux-x86_64-3.6
Unknown argument -j16
Usage: cmake --build <dir> [options] [-- [native-options]]
Options:
  <dir>          = Project binary directory to be built.
  -j [<jobs>] --parallel [<jobs>] = Build in parallel using
                   the given number of jobs. If <jobs> is omitted
                   the native build tool's default number is used.
                   The CMAKE_BUILD_PARALLEL_LEVEL environment variable
                   specifies a default parallel level when this option
                   is not given.
  --target <tgt> = Build <tgt> instead of default targets.
                   May only be specified once.
  --config <cfg> = For multi-configuration tools, choose <cfg>.
  --clean-first  = Build target 'clean' first, then build.
                   (To clean only, use --target 'clean'.)
  --use-stderr   = Ignored.  Behavior is default in CMake >= 3.0.
  --             = Pass remaining options to the native tool.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/setup.py", line 155, in <module>
    keywords='tree nest flatten',
  File "/home/Mousepet/tf2.6.0/lib64/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib64/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/Mousepet/tf2.6.0/lib64/python3.6/site-packages/setuptools/command/install.py", line 68, in run
    return orig.install.run(self)
  File "/usr/lib64/python3.6/distutils/command/install.py", line 556, in run
    self.run_command('build')
  File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib64/python3.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/setup.py", line 72, in run
    self.build_extension(ext)
  File "/tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/setup.py", line 112, in build_extension
    cwd=self.build_temp)
  File "/usr/lib64/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '-j16', '--config', 'Release']' returned non-zero exit status 1.
----------------------------------------

ERROR: Command errored out with exit status 1: /home/Mousepet/tf2.6.0/bin/python3 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/setup.py’“'”‘; file=’“'”‘/tmp/pip-install-txyhsay5/dm-tree_e9e83cd0bec54e08b20576063d7341b6/setup.py’“'”‘;f = getattr(tokenize, ‘"’“‘open’”’“‘, open)(file) if os.path.exists(file) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ install --record /tmp/pip-record-3u617buw/install-record.txt --single-version-externally-managed --compile --install-headers /home/Mousepet/tf2.6.0/include/site/python3.6/dm-tree Check the logs for full command output.