使用python 3.6安装自定义构建tensorflow 1.12车轮时出错

时间:2018-11-26 03:44:51

标签: python-3.x tensorflow hdf5 h5py python-wheel

我正在尝试在ppc64le上安装自定义tensorflow 1.12轮 装有NVIDIA Pascal V100的IBM Power9系统,但出现以下错误:

gcc -pthread -B /ccs/home/shubhankar/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DH5_USE_16_API -I./h5py -I/tmp/pip-install-d__8pdpg/h5py/lzf -I/opt/local/include -I/usr/local/include -I/ccs/home/shubhankar/miniconda3/lib/python3.6/site-packages/numpy/core/include -I/ccs/home/shubhankar/miniconda3/include/python3.6m -c /tmp/pip-install-d__8pdpg/h5py/h5py/defs.c -o build/temp.linux-ppc64le-3.6/tmp/pip-install-d__8pdpg/h5py/h5py/defs.o
    In file included from /ccs/home/shubhankar/miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,
                     from /ccs/home/shubhankar/miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                     from /ccs/home/shubhankar/miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from /tmp/pip-install-d__8pdpg/h5py/h5py/api_compat.h:26,
                     from /tmp/pip-install-d__8pdpg/h5py/h5py/defs.c:657:
    /ccs/home/shubhankar/miniconda3/lib/python3.6/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-d__8pdpg/h5py/h5py/defs.c:657:0:
    /tmp/pip-install-d__8pdpg/h5py/h5py/api_compat.h:27:18: fatal error: hdf5.h: No such file or directory
     #include "hdf5.h"
                      ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
  Rolling back uninstall of h5py
Command "/ccs/home/shubhankar/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-d__8pdpg/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-5_3ofwib/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-d__8pdpg/h5py/

由于某种原因,它在安装h5py时中断。所有这些都以警告消息开头。我不确定是否与此有关。

Cythonizing /tmp/pip-install-d__8pdpg/h5py/h5py/h5z.pyx
    /tmp/pip-install-d__8pdpg/h5py/.eggs/Cython-0.29.1-py3.6-linux-ppc64le.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-d__8pdpg/h5py/h5py/h5z.pxd

最后

Rolling back uninstall of h5py
Command "/ccs/home/shubhankar/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-d__8pdpg/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-5_3ofwib/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-d__8pdpg/h5py/

我正在使用miniconda3进行软件包管理。系统安装的gcc版本是4.8.5

1 个答案:

答案 0 :(得分:0)

您要在非标准架构上安装tensorflow(没有预编译的轮子at PyPI),因此pip必须编译所有内容(包括依赖项,包括h5py )。

要从源代码编译h5py,您需要安装HDF5 1.8.4或更高版本的带有开发标头的 。有关详细信息,请参见http://docs.h5py.org/en/stable/build.html#source-installation

使用可用的软件包管理器安装libhdf5-dev。或install HDF5 from sources