I was hoping someone on here who's familiar with zbar could help me install it properly? Here's what happened: (I'm running Stretch on the Raspberry Pi 3 Model B).

I download the file from here: ZBar bar code reader

The downloaded file has a tar.bz2 extension so I use:

$ tar xvjf zbar-0.10.tar.bz2

to extract it to my desktop.

Then I navigate inside the extracted folder using

$ cd zbar-0.10/

and then I type:

$ ./configure

That seems to run with errors exactly like in this post:

Installation of Zbar failed

After following the above post I use:

sudo apt-get install python-qrtools
sudo apt-get install libzbar-dev
sudo pip install zbar

However there's a segmentation fault when I try and import zbar the same to what is found here:

Zbar Installation

after reading that I saw:

'We believe that the bug you reported is fixed in the latest version of zbar, which is due to be installed in the Debian FTP archive'

Surely this would also apply to Raspbian Stretch?

The whole point of this is to somehow get the zbarcam program/code integrated with my script.

If anyone has any experience with this problem or can help I'd love to hear from you.

  • Is there a reason that you didn't install it with "sudo apt install libzbar0"? It's version 0.10.1. – NomadMaker Aug 2 '18 at 14:21
  • libzbar0 is installed on my system. The segmentation fault happens after using pip install so I'm importing a python 2.7 version of zbar. If I use pip3 install I get an error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1. and 'Failed building wheel for zbar' so I can't even install it for python 3x – user9888433 Aug 2 '18 at 14:29
  • Did you also install "zbar-dbg" and/or "zbar-tools"? – NomadMaker Aug 2 '18 at 14:52
  • Hi NomadMaker I've now installed those but still no luck. Still getting 'failed building wheel for zbar' and error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1 – user9888433 Aug 2 '18 at 15:47

Please revert all what you have done. There is to much mixed up. The best is you start from scratch with a new flashed image. zbar has wide support from the repository. With apt list *zbar* you will find the zbar packages and with:

rpi ~$ apt show libbarcode-zbar-perl libzbar0 libzbargtk0 libzbarqt0 python-zbar python-zbarpygtk zbar-tools

you will find in detail what is supported. I guess you want the python bindings. Then execute:

rpi ~$ sudo apt install python-zbar

That will install it with all necessary dependent packages. It may also help to install

rpi ~$ sudo apt install zbar-tools

This package contains basic applications for decoding captured bar code images and using a video4linux device (e.g. webcam) as a bar code scanner. But I don't know if you really need this. If not then don't install it.

  • Thanks for the response Ingo, I'll give this a go on Monday and keep this thread posted! – user9888433 Aug 3 '18 at 19:41
  • Hi, yes I am using a webcam. I've checked using: sudo apt list --installed and I can confirm zbar and zbar-tools are installed for python 2.7. Thanks for your help. Next thing to do is access the zbarcam application from zbar-tools. – user9888433 Aug 7 '18 at 9:43
  • @user9888433 Glad to help you :-) Can you please accept my answer to finish the question? – Ingo Aug 7 '18 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.