I've got a website hosted at Heroku, and I now want to use the python-qrtools
package which uses the ZBar bar code scanner. On a regular debian (based) I can do a simple:
sudo apt-get install python-qrtools
According to the command dpkg-query -L python-qrtools
, this installs the following:
/usr/lib/python2.7/dist-packages/qrtools-1.2.egg-info
/usr/lib/python2.7/dist-packages/qrtools.py
/usr/share/doc/python-qrtools/copyright
/usr/share/doc/python-qrtools/changelog.Debian.gz
When I look at the imports of qrtools.py
, it also does an import zbar
, which is (as far as I understand) the python binding for the Zbar package (Pypi link here). I'm kinda surprised that zbar or its python bindings are not in the list with the python-qrtools
apt package though. So my first question:
When and where is this zbar package installed?
Moving on I decided to install ZBar and the python binding for it on Heroku. I managed to install ZBar using this ZBar buildpack so I only need to instal the zbar Python binding. From the python command line I already see that it is a binding originating from a .so file:
>>> import zbar
>>> zbar.__file__
'/usr/lib/python2.7/dist-packages/zbar.so'
So I did a simple sudo pip install zbar
, which unfortunately results in a massive compiling error which I pasted below. So my main question is actually the following:
How do I install the zbar python bindings separately (so without apt)? All tips are welcome!
Downloading/unpacking zbar
Downloading zbar-0.10.tar.bz2
Running setup.py (path:/tmp/pip_build_root/zbar/setup.py) egg_info for package zbar
Installing collected packages: zbar
Running setup.py install for zbar
building 'zbar' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c zbarmodule.c -o build/temp.linux-x86_64-2.7/zbarmodule.o
In file included from zbarmodule.c:24:0:
zbarmodule.h:26:18: fatal error: zbar.h: No such file or directory
#include <zbar.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/zbar/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-zIuGzw-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'zbar' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c zbarmodule.c -o build/temp.linux-x86_64-2.7/zbarmodule.o
In file included from zbarmodule.c:24:0:
zbarmodule.h:26:18: fatal error: zbar.h: No such file or directory
#include <zbar.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
So I tried to install the Python zbar binding separately using
Unfortunately I don't even seem to be able to install the zbar package on linux