猿问

无法在 Python3 中升级 pycairo

我正在尝试升级pycairo软件包,但收到以下错误:


$ python3 -m pip install -U pycairo 

Defaulting to user installation because normal site-packages is not writeable

Collecting pycairo

  Using cached pycairo-1.19.1.tar.gz (205 kB)

Installing collected packages: pycairo

    Running setup.py install for pycairo ... 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-ho1du2qw/pycairo/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ho1du2qw/pycairo/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-21711no1/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/abcde/.local/include/python3.7m/pycairo

         cwd: /tmp/pip-install-ho1du2qw/pycairo/

    Complete output (19 lines):

    running install

    running build

    running build_py

    creating build

    creating build/lib.linux-x86_64-3.7

    creating build/lib.linux-x86_64-3.7/cairo

    copying cairo/__init__.py -> build/lib.linux-x86_64-3.7/cairo

    copying cairo/__init__.pyi -> build/lib.linux-x86_64-3.7/cairo

    copying cairo/py.typed -> build/lib.linux-x86_64-3.7/cairo

    running build_ext

    building 'cairo._cairo' extension

    creating build/temp.linux-x86_64-3.7

    creating build/temp.linux-x86_64-3.7/cairo

问题出在哪里?


红颜莎娜
浏览 152回答 1
1回答

侃侃无极

File 意味着您必须使用 C/C++ 标头进行安装,因为它必须编译一些 C/C++ 代码。Python.hpython-dev.h在Linux Mint/Ubuntu/Debian上,它可能是这个命令之一。apt install python-devapt install python3-devapt install python3.7-dev 
随时随地看视频慕课网APP

相关分类

Python
我要回答