19

I'm trying to install pycups in an isolate (--no-site-package) virtualenv with pip, and I'm getting this traceback. I cannot figure out what I'm doing wrong. Any idea?

Thanks,

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 version :

$ python --version
Python 2.7.3

Gcc version :

$ 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) 

1 Answer 1

56

I reproduced this bug on ubuntu 14.04, it should work if you install libcups2-dev:

sudo apt-get install libcups2-dev

This seems to be working up to the latest current version (20.04).

4
  • 4
    You're a life saver. Thank you
    – Jimmy
    Nov 19, 2015 at 15:58
  • Same in Ubuntu 19.10 Nov 25, 2019 at 10:42
  • Confirmed to fix same issue on Raspbian Buster, Python 3 Dec 12, 2019 at 14:40
  • 3
    Works for 20.04 as well Aug 26, 2020 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.