Skip to content

Instantly share code, notes, and snippets.

@Zephor5
Last active July 1, 2023 19:58
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Zephor5/aea563808d80f488310869b69661f330 to your computer and use it in GitHub Desktop.
Save Zephor5/aea563808d80f488310869b69661f330 to your computer and use it in GitHub Desktop.
  1. install zbar on windows with include and library files

  2. make sure mingw installed and bin directory added to the path

  3. in PYTHONPATH\Lib\distutils, create a file distutils.cfg and add two lines:

    [build]

    compiler=mingw32

  4. get dll lib and include file from ftp://sourceware.org/pub/pthreads-win32/dll-latest copy files to PATH_MINGW32/[lib,bin,include] separately, just need file name like pthreadGC2 and remember to chang the name to libpthread

  5. change or add lines in setup.py:

    extra_compile_args=['-std=c99', '-IPATH_TO\ZBar\include', '-lPATH_TO\ZBar\lib'],

    extra_link_args=["PATH_TO\ZBar\lib\libzbar.dll.a"],

    remove line libraries=['zbar'],

  6. run python setup.py install

@vanjavk
Copy link

vanjavk commented Dec 22, 2017

wtf do I need to do on step 4?

@jhgalino
Copy link

jhgalino commented Apr 2, 2018

how to step 4?

@PopeSo
Copy link

PopeSo commented Apr 21, 2018

when i following these instructions i have the same problem as @mattm401
error: command 'c:\mingw\bin\gcc.exe' failed with exit status 1
so what should i do for this issue?

@stupid-venky
Copy link

Can someone please clearly say me the steps to install " Zbarlight " in windows . Cause I'm trying it for long time but I can't able to fix it.

@stupid-venky
Copy link

Can some one help me to install zbar light in windows ?

@ruvi-d
Copy link

ruvi-d commented Nov 12, 2020

@ronytesler
Copy link

@ruvi-d I created a whl file, then ran pip install zbarlight-3.1.dev0-cp38-cp38-win_amd64.whl, but when I add import zbarlight I get an error - ImportError: DLL load failed while importing _zbarlight: The specified module could not be found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment