MacOS10.14 python2.7安装AppKit包的问题

MacOS下使用pip安装python的AppKit package,pip install AppKit
执行过程中报错,完整信息如下:

pip install AppKit

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support

Collecting AppKit

  Using cached https://files.pythonhosted.org/packages/8b/93/5d77e3cccb45a065e9853869af66cf9b09353f51c629cfe040d094620866/AppKit-0.2.8.tar.gz

Collecting flask (from AppKit)

  Using cached https://files.pythonhosted.org/packages/9b/93/628509b8d5dc749656a9641f4caf13540e2cdec85276964ff8f43bbb1d3b/Flask-1.1.1-py2.py3-none-any.whl

Collecting pygobject (from AppKit)

  Using cached https://files.pythonhosted.org/packages/3e/b5/f4fd3351ed074aeeae30bff71428f38bc42187e34c44913239a9dc85a7fc/PyGObject-3.36.0.tar.gz

  Installing build dependencies ... error

  ERROR: Command errored out with exit status 1:

   command: /usr/bin/python /Library/Python/2.7/site-packages/pip-19.2.3-py2.7.egg/pip install --ignore-installed --no-user --prefix /private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-build-env-KEQPtW/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel pycairo

       cwd: None

  Complete output (31 lines):

  DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support

  Collecting setuptools

    Using cached https://files.pythonhosted.org/packages/ab/b5/3679d7c98be5b65fa5522671ef437b792d909cf3908ba54fe9eca5d2a766/setuptools-44.1.0-py2.py3-none-any.whl

  Collecting wheel

    Using cached https://files.pythonhosted.org/packages/8c/23/848298cccf8e40f5bbb59009b32848a4c38f4e7f3364297ab3c3e2e2cd14/wheel-0.34.2-py2.py3-none-any.whl

  Collecting pycairo

    Using cached https://files.pythonhosted.org/packages/3c/1a/c0478ecab31baae50fda9956547788afbd0ca563adc52c9b03cab30f17eb/pycairo-1.18.2.tar.gz

  Installing collected packages: setuptools, wheel, pycairo

    Running setup.py install for pycairo: started

      Running setup.py install for pycairo: finished with status 'error'

      ERROR: Command errored out with exit status 1:

       command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-install-Yi9jsp/pycairo/setup.py'"'"'; __file__='"'"'/private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-install-Yi9jsp/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 /private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-record-50DnQO/install-record.txt --single-version-externally-managed --prefix /private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-build-env-KEQPtW/overlay --compile

           cwd: /private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-install-Yi9jsp/pycairo/

      Complete output (15 lines):

      running install

      running build

      running build_py

      creating build

      creating build/lib.macosx-10.14-intel-2.7

      creating build/lib.macosx-10.14-intel-2.7/cairo

      copying cairo/__init__.py -> build/lib.macosx-10.14-intel-2.7/cairo

      copying cairo/__init__.pyi -> build/lib.macosx-10.14-intel-2.7/cairo

      copying cairo/py.typed -> build/lib.macosx-10.14-intel-2.7/cairo

      running build_ext

      Package cairo was not found in the pkg-config search path.

      Perhaps you should add the directory containing `cairo.pc'

      to the PKG_CONFIG_PATH environment variable

      No package 'cairo' found

      Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.13.1']' returned non-zero exit status 1

      ----------------------------------------

  ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-install-Yi9jsp/pycairo/setup.py'"'"'; __file__='"'"'/private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-install-Yi9jsp/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 /private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-record-50DnQO/install-record.txt --single-version-externally-managed --prefix /private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-build-env-KEQPtW/overlay --compile Check the logs for full command output.

  ----------------------------------------

ERROR: Command errored out with exit status 1: /usr/bin/python /Library/Python/2.7/site-packages/pip-19.2.3-py2.7.egg/pip install --ignore-installed --no-user --prefix /private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-build-env-KEQPtW/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.

经检查核心错误信息为:No package 'cairo' found
经查找到了cairo的官网,在这里了解如何安装cairo模块,MacOS下安装有3中方式

第一种是MacPorts工具,根据连接下载对应系统版本的安装包,下载下来是pkg文件,直接双击安装即可
根据官网提示,在安装前需要先安装xcode,并执行 sudo xcode-select --install sudo xcodebuild -license
安装时间较久,耐心等待。。。

安装完成后,就可以使用sudo port install cairo了

再次执行pip install AppKit, 完美!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

auspark

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值