首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Zbar安装错误

Zbar安装错误
EN

Ask Ubuntu用户
提问于 2020-12-20 06:40:02
回答 2查看 2.1K关注 0票数 3

它是早些时候安装的,但是这个错误再次出现。

代码语言:javascript
复制
sudo apt-get install libzbar-dev

安装Zbar时会出现此错误。

代码语言:javascript
复制
pip3 install zbar

错误

代码语言:javascript
复制
   Building wheel for zbar (setup.py) ... error
      ERROR: Command errored out with exit status 1:
       command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-07_tun3x/zbar_ee181338cecb48f9bdc1dbc37504ffdd/setup.py'"'"'; __file__='"'"'/tmp/pip-install-07_tun3x/zbar_ee181338cecb48f9bdc1dbc37504ffdd/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-d6wmsk5m
           cwd: /tmp/pip-install-07_tun3x/zbar_ee181338cecb48f9bdc1dbc37504ffdd/
      Complete output (55 lines):
      running bdist_wheel
      running build
      running build_ext
      building 'zbar' extension
      creating build
      creating build/temp.linux-x86_64-3.8
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c zbarmodule.c -o build/temp.linux-x86_64-3.8/zbarmodule.o
      In file included from zbarmodule.c:24:
      zbarmodule.h:42:5: error: unknown type name ‘PyIntObject’
         42 |     PyIntObject val;            /* integer value is super type */
            |     ^~~~~~~~~~~
      zbarmodule.c: In function ‘version’:
      zbarmodule.c:66:5: error: too few arguments to function ‘zbar_version’
         66 |     zbar_version(&major, &minor);
            |     ^~~~~~~~~~~~
      In file included from zbarmodule.h:26,
                       from zbarmodule.c:24:
      /usr/include/zbar.h:269:12: note: declared here
        269 | extern int zbar_version(unsigned *major,
            |            ^~~~~~~~~~~~
      zbarmodule.c: In function ‘initzbar’:
      zbarmodule.c:112:9: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
        112 |         return;
            |         ^~~~~~
      zbarmodule.c:106:1: note: declared here
        106 | initzbar (void)
            | ^~~~~~~~
      zbarmodule.c:115:34: error: ‘PyInt_Type’ undeclared (first use in this function); did you mean ‘PySet_Type’?
        115 |     zbarEnumItem_Type.tp_base = &PyInt_Type;
            |                                  ^~~~~~~~~~
            |                                  PySet_Type
      zbarmodule.c:115:34: note: each undeclared identifier is reported only once for each function it appears in
      zbarmodule.c:129:9: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
        129 |         return;
            |         ^~~~~~
      zbarmodule.c:106:1: note: declared here
        106 | initzbar (void)
            | ^~~~~~~~
      zbarmodule.c:137:13: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
        137 |             return;
            |             ^~~~~~
      zbarmodule.c:106:1: note: declared here
        106 | initzbar (void)
            | ^~~~~~~~
      zbarmodule.c:146:21: warning: implicit declaration of function ‘Py_InitModule’ [-Wimplicit-function-declaration]
        146 |     PyObject *mod = Py_InitModule("zbar", zbar_functions);
            |                     ^~~~~~~~~~~~~
      zbarmodule.c:146:21: warning: initialization of ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
      zbarmodule.c:148:9: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
        148 |         return;
            |         ^~~~~~
      zbarmodule.c:106:1: note: declared here
        106 | initzbar (void)
            | ^~~~~~~~
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
      ----------------------------------------
      ERROR: Failed building wheel for zbar
      Running setup.py clean for zbar
    Successfully built pypng qrtools
    Failed to build zbar
    Installing collected packages: zbar, qrtools, pypng
        Running setup.py install for zbar ... error
        ERROR: Command errored out with exit status 1:
         command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-07_tun3x/zbar_ee181338cecb48f9bdc1dbc37504ffdd/setup.py'"'"'; __file__='"'"'/tmp/pip-install-07_tun3x/zbar_ee181338cecb48f9bdc1dbc37504ffdd/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-188bdnav/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/zbar
             cwd: /tmp/pip-install-07_tun3x/zbar_ee181338cecb48f9bdc1dbc37504ffdd/
        Complete output (55 lines):
        running install
        running build
        running build_ext
        building 'zbar' extension
        creating build
        creating build/temp.linux-x86_64-3.8
        x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c zbarmodule.c -o build/temp.linux-x86_64-3.8/zbarmodule.o
        In file included from zbarmodule.c:24:
        zbarmodule.h:42:5: error: unknown type name ‘PyIntObject’
           42 |     PyIntObject val;            /* integer value is super type */
              |     ^~~~~~~~~~~
        zbarmodule.c: In function ‘version’:
        zbarmodule.c:66:5: error: too few arguments to function ‘zbar_version’
           66 |     zbar_version(&major, &minor);
              |     ^~~~~~~~~~~~
        In file included from zbarmodule.h:26,
                         from zbarmodule.c:24:
        /usr/include/zbar.h:269:12: note: declared here
          269 | extern int zbar_version(unsigned *major,
              |            ^~~~~~~~~~~~
        zbarmodule.c: In function ‘initzbar’:
        zbarmodule.c:112:9: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
          112 |         return;
              |         ^~~~~~
        zbarmodule.c:106:1: note: declared here
          106 | initzbar (void)
              | ^~~~~~~~
        zbarmodule.c:115:34: error: ‘PyInt_Type’ undeclared (first use in this function); did you mean ‘PySet_Type’?
          115 |     zbarEnumItem_Type.tp_base = &PyInt_Type;
              |                                  ^~~~~~~~~~
              |                                  PySet_Type
        zbarmodule.c:115:34: note: each undeclared identifier is reported only once for each function it appears in
        zbarmodule.c:129:9: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
          129 |         return;
              |         ^~~~~~
        zbarmodule.c:106:1: note: declared here
          106 | initzbar (void)
              | ^~~~~~~~
        zbarmodule.c:137:13: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
          137 |             return;
              |             ^~~~~~
        zbarmodule.c:106:1: note: declared here
          106 | initzbar (void)
              | ^~~~~~~~
        zbarmodule.c:146:21: warning: implicit declaration of function ‘Py_InitModule’ [-Wimplicit-function-declaration]
          146 |     PyObject *mod = Py_InitModule("zbar", zbar_functions);
              |                     ^~~~~~~~~~~~~
        zbarmodule.c:146:21: warning: initialization of ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
        zbarmodule.c:148:9: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
          148 |         return;
              |         ^~~~~~
        zbarmodule.c:106:1: note: declared here
          106 | initzbar (void)
              | ^~~~~~~~
        error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
        ----------------------------------------
    ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-07_tun3x/zbar_ee181338cecb48f9bdc1dbc37504ffdd/setup.py'"'"'; __file__='"'"'/tmp/pip-install-07_tun3x/zbar_ee181338cecb48f9bdc1dbc37504ffdd/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-188bdnav/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/zbar Check the logs for full command output.
EN

回答 2

Ask Ubuntu用户

发布于 2021-10-12 14:10:31

试一试,对于pyhon3

代码语言:javascript
复制
sudo apt install python3-zbar

对于python2

代码语言:javascript
复制
sudo apt install python-zbar
票数 1
EN

Ask Ubuntu用户

发布于 2022-06-24 11:17:30

或者,使用zbarlight,这是zbar的简单包装器。在GitHub上,最后一次提交是在2020年(zbar-py为2019年),它有156颗星(zbar-py为80 )。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1301509

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档