Failed to install zbar with pip on Windows

前端 未结 1 1165
暖寄归人
暖寄归人 2021-01-18 17:58

I\'m trying to install zbar on my Windows x64 machine:

pip install zbar

And this is what I got:

Collecting zba         


        
相关标签:
1条回答
  • 2021-01-18 18:36

    You are trying to install zbar package with pip. When doing so, pip downloads the source and tries to compile the C/C++ source code of this project.

    To do such a thing, you need a C/C++ compiler and having all dependencies. It may be complicated to have pip compiles this package.

    The other solution is to download a binary wheel that embeds all binaries. zbar developers propose to download a binary wheel from their GitHub webpage

    You can download this binary wheel, that targets a Windows Python 2.7 64 bit installation.

    All you have to do is:

    • open a Windows cli with Windows+R and by running inside cmd
    • go to the directory where you have downloaded the whl file, with cd instructions
    • run pip install zbar-0.10-cp27-none-win_amd64.whl

    For example, the command can be

    pip install zbar-0.10-cp27-none-win_amd64.whl
    

    If you have several Python installations, make sure to use the correct pip program.

    You can do it for any package with some code that has to be compiled

    0 讨论(0)
提交回复
热议问题