./zbarmodule.h:26:10: фатальная ошибка: файл 'zbar.h' не найден

Я пытался установить zbar на мой Macbook.

Когда я выполняю команду pip install zbar (после brew install zbar) Исключение выдается, как показано ниже:

Collecting zbar
  Using cached zbar-0.10.tar.bz2
Installing collected packages: zbar
  Running setup.py install for zbar
    building 'zbar' extension
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c zbarmodule.c -o build/temp.macosx-10.11-intel-2.7/zbarmodule.o
    In file included from zbarmodule.c:24:
    ./zbarmodule.h:26:10: fatal error: 'zbar.h' file not found
    #include <zbar.h>
             ^
    1 error generated.
    error: command 'cc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/var/folders/hx/jbnxkn396zs34xn3fv10tjf40000gn/T/pip-build-PlQauK/zbar/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/hx/jbnxkn396zs34xn3fv10tjf40000gn/T/pip-0yRA4D-record/install-record.txt --single-version-externally-managed --compile:
    running install

    running build

    running build_ext

    building 'zbar' extension

    creating build

    creating build/temp.macosx-10.11-intel-2.7

    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c zbarmodule.c -o build/temp.macosx-10.11-intel-2.7/zbarmodule.o

    In file included from zbarmodule.c:24:

    ./zbarmodule.h:26:10: fatal error: 'zbar.h' file not found

    #include <zbar.h>

             ^

    1 error generated.

    error: command 'cc' failed with exit status 1

    ----------------------------------------
    Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/var/folders/hx/jbnxkn396zs34xn3fv10tjf40000gn/T/pip-build-PlQauK/zbar/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/hx/jbnxkn396zs34xn3fv10tjf40000gn/T/pip-0yRA4D-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /var/folders/hx/jbnxkn396zs34xn3fv10tjf40000gn/T/pip-build-PlQauK/zbar

Есть похожий вопрос, однако ответы не помогают в моем случае.

Я также попробовал другой способ установки по этой ссылке

Однако та же ошибка произошла, когда я печатаю python setup.py install

running install
running build
running build_ext
building 'zbar' extension
creating build
creating build/temp.macosx-10.11-intel-2.7
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c zbarmodule.c -o build/temp.macosx-10.11-intel-2.7/zbarmodule.o
In file included from zbarmodule.c:24:
./zbarmodule.h:26:10: fatal error: 'zbar.h' file not found
#include <zbar.h>
         ^
1 error generated.
error: command 'cc' failed with exit status 1

1 ответ

У меня была такая же проблема, и я бегу conda install zbar, после этого ошибка исчезла.

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