Running setup.py install for h5py ... error

487 views Asked by At

I'm trying to run this repository with TX2 but I stuck in some errors. The requirement of this repository is flahsing JetPack 4.2 but I couldn't flash it because there's no JetPack 4.2. Then, I've installed JetPack 4.5 on this webpage, not JetPack 4.2.

After that, I tried to install wheel file but there are some errors with below codes.

sudo apt update
sudo apt upgrade

sudo apt-get install python-setuptools
sudo apt-get install python-pip
cd ~/Downloads
sudo pip install tensorflow-1.12.1-cp27-cp27mu-linux_aarch64.whl
The directory '/home/nvidia/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/nvidia/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Processing ./tensorflow-1.12.1-cp27-cp27mu-linux_aarch64.whl
Requirement already satisfied: astor>=0.6.0 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorflow==1.12.1)
Requirement already satisfied: termcolor>=1.1.0 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorflow==1.12.1)
Requirement already satisfied: numpy>=1.13.3 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorflow==1.12.1)
Requirement already satisfied: tensorboard<1.13.0,>=1.12.0 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorflow==1.12.1)
Requirement already satisfied: six>=1.10.0 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorflow==1.12.1)
Requirement already satisfied: backports.weakref>=1.0rc1 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorflow==1.12.1)
Requirement already satisfied: absl-py>=0.1.6 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorflow==1.12.1)
Requirement already satisfied: wheel in /home/nvidia/.local/lib/python2.7/site-packages (from tensorflow==1.12.1)
Requirement already satisfied: gast>=0.2.0 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorflow==1.12.1)
Requirement already satisfied: keras-preprocessing>=1.0.5 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorflow==1.12.1)
Requirement already satisfied: protobuf>=3.6.1 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorflow==1.12.1)
Requirement already satisfied: enum34>=1.1.6 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorflow==1.12.1)
Collecting keras-applications>=1.0.6 (from tensorflow==1.12.1)
Collecting mock>=2.0.0 (from tensorflow==1.12.1)
  Downloading https://files.pythonhosted.org/packages/05/d2/f94e68be6b17f46d2c353564da56e6fb89ef09faeeff3313a046cb810ca9/mock-3.0.5-py2.py3-none-any.whl
Requirement already satisfied: grpcio>=1.8.6 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorflow==1.12.1)
Requirement already satisfied: markdown>=2.6.8 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorboard<1.13.0,>=1.12.0->tensorflow==1.12.1)
Requirement already satisfied: werkzeug>=0.11.10 in /home/nvidia/.local/lib/python2.7/site-packages (from tensorboard<1.13.0,>=1.12.0->tensorflow==1.12.1)
Requirement already satisfied: futures>=3.1.1; python_version < "3" in /home/nvidia/.local/lib/python2.7/site-packages (from tensorboard<1.13.0,>=1.12.0->tensorflow==1.12.1)
Collecting h5py (from keras-applications>=1.0.6->tensorflow==1.12.1)
  Downloading https://files.pythonhosted.org/packages/5f/97/a58afbcf40e8abecededd9512978b4e4915374e5b80049af082f49cebe9a/h5py-2.10.0.tar.gz (301kB)
    100% |████████████████████████████████| 307kB 1.9MB/s 
Requirement already satisfied: funcsigs>=1; python_version < "3.3" in /usr/lib/python2.7/dist-packages (from mock>=2.0.0->tensorflow==1.12.1)
Requirement already satisfied: setuptools>=36 in /home/nvidia/.local/lib/python2.7/site-packages (from markdown>=2.6.8->tensorboard<1.13.0,>=1.12.0->tensorflow==1.12.1)
Installing collected packages: h5py, keras-applications, mock, tensorflow
  Running setup.py install for h5py ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6EHebF/h5py/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-4T2QcD-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-aarch64-2.7
    creating build/lib.linux-aarch64-2.7/h5py
    copying h5py/ipy_completer.py -> build/lib.linux-aarch64-2.7/h5py
    copying h5py/version.py -> build/lib.linux-aarch64-2.7/h5py
    copying h5py/__init__.py -> build/lib.linux-aarch64-2.7/h5py
    copying h5py/h5py_warnings.py -> build/lib.linux-aarch64-2.7/h5py
    copying h5py/highlevel.py -> build/lib.linux-aarch64-2.7/h5py
    creating build/lib.linux-aarch64-2.7/h5py/_hl
    copying h5py/_hl/vds.py -> build/lib.linux-aarch64-2.7/h5py/_hl
    copying h5py/_hl/group.py -> build/lib.linux-aarch64-2.7/h5py/_hl
    copying h5py/_hl/selections.py -> build/lib.linux-aarch64-2.7/h5py/_hl
    copying h5py/_hl/dataset.py -> build/lib.linux-aarch64-2.7/h5py/_hl
    copying h5py/_hl/filters.py -> build/lib.linux-aarch64-2.7/h5py/_hl
    copying h5py/_hl/selections2.py -> build/lib.linux-aarch64-2.7/h5py/_hl
    copying h5py/_hl/__init__.py -> build/lib.linux-aarch64-2.7/h5py/_hl
    copying h5py/_hl/dims.py -> build/lib.linux-aarch64-2.7/h5py/_hl
    copying h5py/_hl/files.py -> build/lib.linux-aarch64-2.7/h5py/_hl
    copying h5py/_hl/attrs.py -> build/lib.linux-aarch64-2.7/h5py/_hl
    copying h5py/_hl/compat.py -> build/lib.linux-aarch64-2.7/h5py/_hl
    copying h5py/_hl/datatype.py -> build/lib.linux-aarch64-2.7/h5py/_hl
    copying h5py/_hl/base.py -> build/lib.linux-aarch64-2.7/h5py/_hl
    creating build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_filters.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_file2.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_attrs.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_h5t.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/common.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_slicing.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_h5pl.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/__init__.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_attrs_data.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_attribute_create.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_h5d_direct_chunk.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_dataset_getitem.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_h5f.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_group.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_h5p.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_selections.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_datatype.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_dimension_scales.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_file.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_dataset.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_base.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_deprecation.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_file_image.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_dims_dimensionproxy.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_h5.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_objects.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_threads.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_completions.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_dtype.py -> build/lib.linux-aarch64-2.7/h5py/tests
    copying h5py/tests/test_dataset_swmr.py -> build/lib.linux-aarch64-2.7/h5py/tests
    creating build/lib.linux-aarch64-2.7/h5py/tests/test_vds
    copying h5py/tests/test_vds/test_virtual_source.py -> build/lib.linux-aarch64-2.7/h5py/tests/test_vds
    copying h5py/tests/test_vds/__init__.py -> build/lib.linux-aarch64-2.7/h5py/tests/test_vds
    copying h5py/tests/test_vds/test_highlevel_vds.py -> build/lib.linux-aarch64-2.7/h5py/tests/test_vds
    copying h5py/tests/test_vds/test_lowlevel_vds.py -> build/lib.linux-aarch64-2.7/h5py/tests/test_vds
    running build_ext
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-6EHebF/h5py/setup.py", line 159, in <module>
        cmdclass = CMDCLASS,
      File "/home/nvidia/.local/lib/python2.7/site-packages/setuptools/__init__.py", line 162, 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 "/home/nvidia/.local/lib/python2.7/site-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 "setup_build.py", line 166, in run
        config.run()
      File "setup_configure.py", line 160, in run
        self.hdf5_version = autodetect_version(self.hdf5)
      File "setup_configure.py", line 196, in autodetect_version
        import pkgconfig
      File "/tmp/pip-build-6EHebF/h5py/.eggs/pkgconfig-1.5.3-py2.7.egg/pkgconfig/__init__.py", line 1, in <module>
        from .pkgconfig import *
      File "/tmp/pip-build-6EHebF/h5py/.eggs/pkgconfig-1.5.3-py2.7.egg/pkgconfig/pkgconfig.py", line 281
        flags = _query(packages, *os_opts, *_build_options(option, static=static))
                                           ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6EHebF/h5py/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-4T2QcD-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-6EHebF/h5py/

Please help me and feel free to ask anything about it. Thank you for reading it.

0

There are 0 answers