本文主要是介绍pygobject pip3升级问题:ERROR: Failed building wheel for pycairo,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
问题
这个问题是从很长一段问题中截出来的,全文如下,是使用pip3
或者说pip-review
升级遇到的问题
pygobject==3.34.0 is available (you have 3.26.1)
Defaulting to user installation because normal site-packages is not writeable
Processing /home/thinszx/.cache/pip/wheels/78/4f/f8/35219d6282fc7d90d6713924a12fd05bb0f7eef0fa12bef507/distro_info-0.0.0-py3-none-any.whl
Collecting pygobject==3.34.0Using cached PyGObject-3.34.0.tar.gz (699 kB)Installing build dependencies ... errorERROR: Command errored out with exit status 1:command: /usr/bin/python3 /home/thinszx/.local/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-pbwzvrms/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel pycairocwd: NoneComplete output (50 lines):Collecting setuptoolsUsing cached setuptools-45.2.0-py3-none-any.whl (584 kB)Collecting wheelUsing cached wheel-0.34.2-py2.py3-none-any.whl (26 kB)Collecting pycairoUsing cached pycairo-1.19.0.tar.gz (200 kB)Building wheels for collected packages: pycairoBuilding wheel for pycairo (setup.py): startedBuilding wheel for pycairo (setup.py): finished with status '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-sa57e6b8/pycairo/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sa57e6b8/pycairo/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-pgit5hrhcwd: /tmp/pip-install-sa57e6b8/pycairo/Complete output (12 lines):running bdist_wheelrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.6creating build/lib.linux-x86_64-3.6/cairocopying cairo/__init__.py -> build/lib.linux-x86_64-3.6/cairocopying cairo/__init__.pyi -> build/lib.linux-x86_64-3.6/cairocopying cairo/py.typed -> build/lib.linux-x86_64-3.6/cairorunning build_ext'pkg-config' not found.Command ['pkg-config', '--print-errors', '--exists', 'cairo >= 1.13.1']----------------------------------------ERROR: Failed building wheel for pycairoRunning setup.py clean for pycairoFailed to build pycairoInstalling collected packages: setuptools, wheel, pycairoRunning setup.py install for pycairo: startedRunning setup.py install for pycairo: finished with status '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-sa57e6b8/pycairo/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sa57e6b8/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-y2i60oh4/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-pbwzvrms/overlay --compile --install-headers /tmp/pip-build-env-pbwzvrms/overlay/include/python3.6m/pycairo cwd: /tmp/pip-install-sa57e6b8/pycairo/Complete output (12 lines):running installrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.6creating build/lib.linux-x86_64-3.6/cairocopying cairo/__init__.py -> build/lib.linux-x86_64-3.6/cairocopying cairo/__init__.pyi -> build/lib.linux-x86_64-3.6/cairocopying cairo/py.typed -> build/lib.linux-x86_64-3.6/cairorunning build_ext'pkg-config' not found.Command ['pkg-config', '--print-errors', '--exists', 'cairo >= 1.13.1']----------------------------------------ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sa57e6b8/pycairo/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sa57e6b8/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-y2i60oh4/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-pbwzvrms/overlay --compile --install-headers /tmp/pip-build-env-pbwzvrms/overlay/include/python3.6m/pycairo Check the logs for full command output.----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /home/thinszx/.local/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-pbwzvrms/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel pycairo Check the logs for full command output.
解决方法
查到了ubuntu 小白,对于 package 升级的问题 - V2EX,说是pip或者pip3升级都会有问题,因为少了libgirepository1.0-dev
的依赖,安装
sudo apt-get install libgirepository1.0-dev
然后还少一个cario
sudo apt-get install python-cairo
sudo apt-get install libcairo2
这篇关于pygobject pip3升级问题:ERROR: Failed building wheel for pycairo的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!