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

I am trying to get started pip install zbar

and for some reason I cannot find an answer to solve this dependency issue. Any help would be greatly appreciated. See Trail 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

      

+3


source to share


4 answers


$ brew install zbar

      

and after that



$ pip install zbar

      

Then the header files (zbar.h) will be found

+4


source


This problem happened again after 2 years ... this is what worked for me



LDFLAGS=-L/usr/local/lib/ CPATH=/usr/local/include/ pip install zbar

      

+4


source


In my case, I ran Ubuntu

and had to install the package libzbar-dev

:
sudo apt-get install libzbar-dev

+1


source


In case other users face this problem, cannot use pip

to install zbar for python:

Install zbar: brew install zbar

Install PIL: brew install pillow

Download zbar source: https://pypi.python.org/pypi/zbar

Unzip zbar: tar -xjvf zbar-0.10.tar.bz2

Install: python setup.py install --user

0


source







All Articles