Не может установить h5py

У меня есть Ubuntu 16.04.5 и пытающийся установить Keras. Мне нужен h5py к этому, но у меня есть проблема с установкой его. Когда я ввожу:

sudo pip install h5py

Я получил это:

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.
Collecting h5py
  Downloading https://files.pythonhosted.org/packages/74/5d/6f11a5fffc3d8884bb8d6c06abbee0b3d7c8c81bde9819979208ba823a47/h5py-2.8.0.tar.gz (274kB)
    100% |████████████████████████████████| 276kB 1.7MB/s
Requirement already satisfied: numpy>=1.7 in /home/nvidia/.local/lib/python3.5/site-packages (from h5py) (1.15.4)
Requirement already satisfied: six in /home/nvidia/.local/lib/python3.5/site-packages (from h5py) (1.11.0)
Installing collected packages: h5py
  Running setup.py install for h5py ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-49wsh8ku/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-record-ltnxb8_8/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-aarch64-3.5
    creating build/lib.linux-aarch64-3.5/h5py
    copying h5py/__init__.py -> build/lib.linux-aarch64-3.5/h5py
    copying h5py/version.py -> build/lib.linux-aarch64-3.5/h5py
    copying h5py/h5py_warnings.py -> build/lib.linux-aarch64-3.5/h5py
    copying h5py/highlevel.py -> build/lib.linux-aarch64-3.5/h5py
    copying h5py/ipy_completer.py -> build/lib.linux-aarch64-3.5/h5py
    creating build/lib.linux-aarch64-3.5/h5py/_hl
    copying h5py/_hl/__init__.py -> build/lib.linux-aarch64-3.5/h5py/_hl
    copying h5py/_hl/selections2.py -> build/lib.linux-aarch64-3.5/h5py/_hl
    copying h5py/_hl/dims.py -> build/lib.linux-aarch64-3.5/h5py/_hl
    copying h5py/_hl/attrs.py -> build/lib.linux-aarch64-3.5/h5py/_hl
    copying h5py/_hl/base.py -> build/lib.linux-aarch64-3.5/h5py/_hl
    copying h5py/_hl/datatype.py -> build/lib.linux-aarch64-3.5/h5py/_hl
    copying h5py/_hl/dataset.py -> build/lib.linux-aarch64-3.5/h5py/_hl
    copying h5py/_hl/files.py -> build/lib.linux-aarch64-3.5/h5py/_hl
    copying h5py/_hl/compat.py -> build/lib.linux-aarch64-3.5/h5py/_hl
    copying h5py/_hl/group.py -> build/lib.linux-aarch64-3.5/h5py/_hl
    copying h5py/_hl/filters.py -> build/lib.linux-aarch64-3.5/h5py/_hl
    copying h5py/_hl/selections.py -> build/lib.linux-aarch64-3.5/h5py/_hl
    creating build/lib.linux-aarch64-3.5/h5py/tests
    copying h5py/tests/__init__.py -> build/lib.linux-aarch64-3.5/h5py/tests
    copying h5py/tests/common.py -> build/lib.linux-aarch64-3.5/h5py/tests
    creating build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/__init__.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_h5t.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_dataset.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_objects.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_group.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_h5p.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_attrs.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_dimension_scales.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_datatype.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_h5f.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_slicing.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_h5d_direct_chunk_write.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_base.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_file.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_h5.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_selections.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_attrs_data.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    copying h5py/tests/old/test_file_image.py -> build/lib.linux-aarch64-3.5/h5py/tests/old
    creating build/lib.linux-aarch64-3.5/h5py/tests/hl
    copying h5py/tests/hl/__init__.py -> build/lib.linux-aarch64-3.5/h5py/tests/hl
    copying h5py/tests/hl/test_threads.py -> build/lib.linux-aarch64-3.5/h5py/tests/hl
    ...
    warning: h5py/api_types_hdf5.pxd:493:4: 'H5T_CSET_ERROR' redeclared
    warning: h5py/api_types_hdf5.pxd:494:4: 'H5T_CSET_ASCII' redeclared
    warning: h5py/api_types_hdf5.pxd:637:2: 'H5Z_filter_t' redeclared
    warning: h5py/api_types_hdf5.pxd:672:6: 'H5Z_ERROR_EDC' redeclared
    warning: h5py/api_types_hdf5.pxd:673:6: 'H5Z_DISABLE_EDC' redeclared
    warning: h5py/api_types_hdf5.pxd:674:6: 'H5Z_ENABLE_EDC' redeclared
    warning: h5py/api_types_hdf5.pxd:675:6: 'H5Z_NO_EDC' redeclared
    [ 8/22] Cythonizing /tmp/pip-install-49wsh8ku/h5py/h5py/h5ac.pyx
    /tmp/pip-install-49wsh8ku/h5py/.eggs/Cython-0.29-py3.5-linux-aarch64.egg/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-49wsh8ku/h5py/h5py/h5ac.pxd
      tree = Parsing.p_module(s, pxd, full_module_name)
    warning: h5py/api_types_hdf5.pxd:350:2: 'H5D_layout_t' redeclared
    warning: h5py/api_types_hdf5.pxd:357:2: 'H5D_alloc_time_t' redeclared
    warning: h5py/api_types_hdf5.pxd:364:2: 'H5D_space_status_t' redeclared
    warning: h5py/api_types_hdf5.pxd:370:2: 'H5D_fill_time_t' redeclared
    warning: h5py/api_types_hdf5.pxd:376:2: 'H5D_fill_value_t' redeclared
    warning: h5py/api_types_hdf5.pxd:388:7: 'H5F_close_degree_t' redeclared
    warning: h5py/api_types_hdf5.pxd:394:2: 'H5FD_mem_t' redeclared
   ...
    building 'h5py.defs' extension
    creating build/temp.linux-aarch64-3.5
    creating build/temp.linux-aarch64-3.5/tmp
    creating build/temp.linux-aarch64-3.5/tmp/pip-install-49wsh8ku
    creating build/temp.linux-aarch64-3.5/tmp/pip-install-49wsh8ku/h5py
    creating build/temp.linux-aarch64-3.5/tmp/pip-install-49wsh8ku/h5py/h5py
    aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DH5_USE_16_API -I./h5py -I/tmp/pip-install-49wsh8ku/h5py/lzf -I/opt/local/include -I/usr/local/include -I/home/nvidia/.local/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -c /tmp/pip-install-49wsh8ku/h5py/h5py/defs.c -o build/temp.linux-aarch64-3.5/tmp/pip-install-49wsh8ku/h5py/h5py/defs.o
    In file included from /home/nvidia/.local/lib/python3.5/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,
                     from /home/nvidia/.local/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                     from /home/nvidia/.local/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from /tmp/pip-install-49wsh8ku/h5py/h5py/api_compat.h:26,
                     from /tmp/pip-install-49wsh8ku/h5py/h5py/defs.c:654:
    /home/nvidia/.local/lib/python3.5/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it by " \
      ^
    In file included from /tmp/pip-install-49wsh8ku/h5py/h5py/defs.c:654:0:
    /tmp/pip-install-49wsh8ku/h5py/h5py/api_compat.h:27:18: fatal error: hdf5.h: No such file or directory
    compilation terminated.
    error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

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

Я пытался очистить кэш, зернышко обновления или использование - no-cache-dir. Ничто не помогает.Что мне делать?

0
задан 16 November 2018 в 04:30

1 ответ

h5py для Python 2.x может быть установлен из репозиториев по умолчанию во всех в настоящее время поддерживаемых версиях Ubuntu со следующей командой:

sudo apt install python-h5py

h5py для Python 3.x может быть установлен из репозиториев по умолчанию во всех в настоящее время поддерживаемых версиях Ubuntu со следующей командой:

sudo apt install python3-h5py  

HDF5 для Python (h5py) является интерфейсом Python общего назначения к библиотеке Hierarchical Data Format, версия 5. HDF5 является универсальной, сформировавшейся научной библиотекой программного обеспечения, разработанной для быстрого, гибкого устройства хранения данных огромных объемов данных.

1
ответ дан 27 October 2019 в 04:28

Другие вопросы по тегам:

Похожие вопросы: