‘pip install pycups’ 出现错误,退出状态为 1

‘pip install pycups’ 出现错误,退出状态为 1

我正在安装 Odoo 8,使用 Python 2.7 和 pip 20.3.4。我知道 Odoo 的版本很旧,但我需要使用它。我无法安装 pycups,也不知道问题出在哪里。

Collecting pycups
  Using cached pycups-2.0.1.tar.gz (62 kB)
Using legacy 'setup.py install' for pycups, since package 'wheel' is not installed.
Installing collected packages: pycups
    Running setup.py install for pycups ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-Ik_tSW/pycups/setup.py'"'"'; __file__='"'"'/tmp/pip-install-Ik_tSW/pycups/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-GdY6lB/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python2.7/pycups
         cwd: /tmp/pip-install-Ik_tSW/pycups/
    Complete output (1430 lines):
    running install
    running build
    running build_ext
    building 'cups' extension
    creating build
    creating build/temp.linux-x86_64-2.7
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DVERSION="2.0.1" -I/usr/include/python2.7 -c cupsmodule.c -o build/temp.linux-x86_64-2.7/cupsmodule.o
    cupsmodule.c: En la función ‘cups_modelSort’:
    cupsmodule.c:184:3: aviso: declaración implícita de la función ‘PyUnicode_GetLength’ [-Wimplicit-function-declaration]
       len_a = 1 + (long unsigned)PyUnicode_GetLength (a);
       ^
    cupsmodule.c:212:3: aviso: se pasa el argumento 1 de ‘PyUnicodeUCS4_AsWideChar’ desde un tipo de puntero incompatible [activado por defecto]
       PyUnicode_AsWideChar (a, wca, size_a);
       ^
    In file included from /usr/include/python2.7/Python.h:85:0,
                     from cupsmodule.c:23:
    /usr/include/python2.7/unicodeobject.h:246:31: nota: se esperaba ‘struct PyUnicodeObject *’ pero el argumento es de tipo ‘struct PyObject *’
     # define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar
                                   ^
    /usr/include/python2.7/unicodeobject.h:591:24: nota: in expansion of macro ‘PyUnicode_AsWideChar’
     PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
                            ^
    cupsmodule.c:213:3: aviso: se pasa el argumento 1 de ‘PyUnicodeUCS4_AsWideChar’ desde un tipo de puntero incompatible [activado por defecto]
       PyUnicode_AsWideChar (b, wcb, size_b);
       ^
 cupsmodule.c:1176:3: nota: in expansion of macro ‘INT_17_CONSTANT_NEWNAME’
       INT_17_CONSTANT_NEWNAME (IPP_OP_CUPS_GET_DOCUMENT, CUPS_GET_DOCUMENT);
       ^
    error: command 'gcc' failed with exit status 1
..........................
error
ERROR: Command errored out with exit status 1: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-WzC5lf/pycups/setup.py'"'"'; __file__='"'"'/tmp/pip-install-WzC5lf/pycups/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-UingDu/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python2.7/pycups Check the logs for full command output.

答案1

安装python-unidecode, 有用。

相关内容