Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

#include <zbar.h> 1 error generated when running pip install zbar

Tags:

c++

python

django

I'm trying to run pip install zbar and for some reason I can't seem to find an answer to solve this dependency issue. Any help would be extremely appreciated. See traceback below:

Downloading/unpacking zbar
  Downloading zbar-0.10.tar.bz2
  Running setup.py 
 egg_info for package zbar

Installing collected packages: zbar
  Running setup.py install for zbar
    building 'zbar' extension
    clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c zbarmodule.c -o build/temp.macosx-10.9-x86_64-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 'clang' failed with exit status 1

   running install

running build

running build_ext

building 'zbar' extension

creating build

creating build/temp.macosx-10.9-x86_64-2.7

clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c zbarmodule.c -o build/temp.macosx-10.9-x86_64-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 'clang' failed with exit status 1
like image 465
Matt Avatar asked Aug 13 '14 01:08

Matt


2 Answers

$ brew install zbar

and after that

$ pip install zbar

The header files will then be found (zbar.h)

like image 186
nelsonvarela Avatar answered Sep 19 '22 18:09

nelsonvarela


In my case I was running Ubuntu and had to install libzbar-dev package:
sudo apt-get install libzbar-dev

like image 31
Aleksandr Tukallo Avatar answered Sep 21 '22 18:09

Aleksandr Tukallo