gpt4 book ai didi

linux - 由于找不到 cups/cups.h,无法使用 pip 安装 pycups

转载 作者:IT王子 更新时间:2023-10-29 01:02:49 28 4
gpt4 key购买 nike

我正在尝试使用 pip 在隔离 (--no-site-package) virtualenv 中安装 pycups,我得到了这个回溯。我无法弄清楚我做错了什么。有什么想法吗?

谢谢,

Downloading/unpacking pycups
Running setup.py egg_info for package pycups

Installing collected packages: pycups
Running setup.py install for pycups
building 'cups' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DVERSION="1.9.66" -I/usr/include/python2.7 -c cupsmodule.c -o build/temp.linux-x86_64-2.7/cupsmodule.o
cupsmodule.c:23:23: fatal error: cups/cups.h: El fitxer o directori no existeix
compilation terminated.
error: command 'gcc' failed with exit status 1
Complete output from command /home/jmartin/workspace/trytond/bin/python -c "import setuptools;__file__='/home/jmartin/workspace/trytond/build/pycups/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-NbMOAM-record/install-record.txt --single-version-externally-managed --install-headers /home/jmartin/workspace/trytond/include/site/python2.7:
running install

running build

running build_ext

building 'cups' extension

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DVERSION="1.9.66" -I/usr/include/python2.7 -c cupsmodule.c -o build/temp.linux-x86_64-2.7/cupsmodule.o

cupsmodule.c:23:23: fatal error: cups/cups.h: El fitxer o directori no existeix

compilation terminated.

error: command 'gcc' failed with exit status 1

----------------------------------------
Command /home/jmartin/workspace/trytond/bin/python -c "import setuptools;__file__='/home/jmartin/workspace/trytond/build/pycups/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-NbMOAM-record/install-record.txt --single-version-externally-managed --install-headers /home/jmartin/workspace/trytond/include/site/python2.7 failed with error code 1 in /home/jmartin/workspace/trytond/build/pycups
Storing complete log in /home/jmartin/.pip/pip.log

Python 版本:

$ python --version
Python 2.7.3

海湾合作委员会版本:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

最佳答案

我在 ubuntu 14.04 上重现了这个错误,如果你安装 libcups2-dev 它应该可以工作:

sudo apt-get install libcups2-dev

这似乎适用于最新的当前版本 (20.04)。

关于linux - 由于找不到 cups/cups.h,无法使用 pip 安装 pycups,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23659097/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com