由于没有找到杯子/杯子,无法用pip安装pycups

时间:2014-05-14 15:32:47

标签: linux python-2.7 virtualenv

我正在尝试使用pip在{(1 {}})virtualenv中安装pycups,我正在获得此回溯。我无法弄清楚我做错了什么。有什么想法吗?

谢谢,

--no-site-package

Python版本:

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

Gcc版本:

$ python --version
Python 2.7.3

1 个答案:

答案 0 :(得分:15)

我在ubuntu 14.04上重现了这个bug。如果你安装了libcups2-dev:

,它应该可以工作

sudo apt-get install libcups2-dev