我正在尝试安装Neon,一个机器学习包(http://neon.nervanasys.com/docs/latest/installation.html),克隆了Github存储库,cd到neon
目录,然后运行make
命令我遇到了以下错误:
^
In file included from /tmp/pip-build-2yDIC3/h5py/h5py/defs.c:279:0:
/tmp/pip-build-2yDIC3/h5py/h5py/api_compat.h:27:18: fatal error: hdf5.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/kurt/Documents/Python/neon/.venv2/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2yDIC3/h5py/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ArslBc-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/kurt/Documents/Python/neon/.venv2/include/site/python2.7/h5py" failed with error code 1 in /tmp/pip-build-2yDIC3/h5py/
Makefile:115: recipe for target '.venv2/bin/activate' failed
make: *** [.venv2/bin/activate] Error 1
该错误似乎与h5py有关,这是一项要求。但是,这似乎已正确安装:
kurt@kurt-ThinkPad:~$ sudo pip install h5py
The directory '/home/kurt/.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/kurt/.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.
Requirement already satisfied (use --upgrade to upgrade): h5py in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6.1 in /usr/local/lib/python2.7/dist-packages (from h5py)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from h5py)
我也尝试设置硬链接到hdf5的lib名称的“连续”后缀,如https://github.com/NVIDIA/DIGITS/issues/156中所述,但无济于事。奇怪的是,如果我再次运行make
命令,我不会得到相同的错误消息,但以下内容:
kurt@kurt-ThinkPad:~/Documents/Python/neon$ make
make[1]: Entering directory '/home/kurt/Documents/Python/neon/loader'
Building bin/loader.so...
g++ -shared -o bin/loader.so -fPIC -Wall -Wno-deprecated-declarations -O3 -std=c++11 -DHAS_IMGLIB -DHAS_VIDLIB -DHAS_AUDLIB src/loader.cpp -I/usr/include/opencv -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -lavutil -lavformat -lavcodec -lswscale
make[1]: Leaving directory '/home/kurt/Documents/Python/neon/loader'
它说“离开目录”没有明确的错误消息,但是当我尝试导入neon
模块时,我得到ImportError: No module named neon...
错误。
有关如何解决此问题的任何想法?
答案 0 :(得分:0)
根据Evert的建议(并仔细阅读说明),我从http://packages.ubuntu.com/trusty/amd64/libhdf5-dev/download的.deb文件中安装了libhdf5-dev
。在neon
工作之后。 (它必须从虚拟环境运行。)