zbar missing from Python site-pakages after install

我们两清 提交于 2019-12-11 15:38:48

问题


Win 10, x64, Python 2.7, Anaconda

There's at least 2 posts about this here. Neither solve my problem.

I'm trying to read QR codes so have installed zbar after downloading the wheel using pip install zbar-0.10-cp27-none-win_amd64.whl

I had tried installing with pip install zbar with no luck (yes I installed the appropriate version of VS).

As as far as the conda comand line is concerned zbar has been installed.

So I tried to run the following program....

import pyqrcode
from qrtools import QR

Q = pyqrcode.create('Q')

Q.png('Q.png', scale=55)#, module_color=[0, 0, 0, 128], background=[0xff, 0xff, 0xcc])

Q.show(wait=1.2, scale=10, module_color=(0, 0, 0, 255), background=(255, 255, 255, 255), quiet_zone=4)

D = QR(filename='Q.png')
D.data_to_string()

The resulting traceback...

Traceback (most recent call last):

  File "<ipython-input-10-ecc93a89ee73>", line 1, in <module>
    runfile('C:/Users/Technical/Moving_Targets/barcode-scanner/QR_code_example.py', wdir='C:/Users/Technical/Moving_Targets/barcode-scanner')

  File "C:\ProgramData\Anaconda2\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 668, in runfile
    execfile(filename, namespace)

  File "C:\ProgramData\Anaconda2\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 93, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "C:/Users/Technical/Moving_Targets/barcode-scanner/QR_code_example.py", line 9, in <module>
    from qrtools import QR

  File "C:\ProgramData\Anaconda2\lib\site-packages\qrtools\__init__.py", line 4, in <module>
    from qrtools.qrtools import *

  File "C:\ProgramData\Anaconda2\lib\site-packages\qrtools\qrtools.py", line 28, in <module>
    import zbar

ImportError: DLL load failed: The specified module could not be found.

So I have a look for the DLL and discover that zbar is missing from the site-packages folder where I was expecting it

The distribution information is there but no actual package!

Where could it be?

Additional note: I have a version of zbar that is an independent stand alone executable (that will only run from the command line & wont let me use os.system() or subprocess.call() for some unknown reason) it works just fine.

来源:https://stackoverflow.com/questions/54294217/zbar-missing-from-python-site-pakages-after-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!