Skip to main content

zbar lite package only support scan image and recognize barcode

Project description

This package is a part of ZBAR, only supports image related functions. For now , it is only designed for Python.

It is recommended for you to run cmd below first.

cd zbar
autoreconf -vfi
./configure --without-java --without-gtk \
--without-qt  --without-imagemagick  --disable-video --without-python

the host you should fill with something according to your own compiler.

then run

sh preparation.sh

before build, you should make sure that your gcc compiler is fit with your OS.

you can install gcc build env from https://sourceforge.net/projects/mingw-w64/files/ for windows

Notice that mingw64 and mingw-w64 is not the same thing.

I select x86_64-win32-seh to build my wheel.

python setup.py build -c mingw32

to build whl

python setup.py bdist_wheel

to install

python setup.py install

Some errors you could meet:

cannot find -lmsvcr140

if you build this whl in Windows with python setup.py build_ext --compiler=mingw32, you may meet an error that cannot find -lmsvcr140, as you can see in https://stackoverflow.com/questions/43873604/where-is-msvcr140-dll-does-it-exist.

There are two solutions:

  1. modify func get_msvcr in distutils.cygwinccompiler to
def get_msvcr():
    """Include the appropriate MSVC runtime library if Python was built
    with MSVC 7.0 or later.
    """
    msc_pos = sys.version.find('MSC v.')
    if msc_pos != -1:
        msc_ver = sys.version[msc_pos+6:msc_pos+10]
        if msc_ver == '1300':
            # MSVC 7.0
            return ['msvcr70']
        elif msc_ver == '1310':
            # MSVC 7.1
            return ['msvcr71']
        elif msc_ver == '1400':
            # VS2005 / MSVC 8.0
            return ['msvcr80']
        elif msc_ver == '1500':
            # VS2008 / MSVC 9.0
            return ['msvcr90']
        elif msc_ver == '1600':
            # VS2010 / MSVC 10.0
            return ['msvcr100']
        elif int(msc_ver) >= 1900:
            # VS2015 / MSVC 14.0
            return ['vcruntime140']
        else:
            raise ValueError("Unknown MS Compiler version %s " % msc_ver)
  1. modify Mingw32CCompiler , comment self.dll_libraries = get_msvcr()

For more documents you can visit https://github.com/mchehab/zbar/tree/master/python

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

zbar_lite-0.23.1-cp38-cp38-win_amd64.whl (775.0 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page