首页 > 解决方案 > pip 命令“gcc”在安装 setproctitle 时失败,退出状态为 1

问题描述

我正在尝试在 OS X 10.14 上使用 pip (Python 3.6) 安装 setproctitle:

(venv36) MacBook-Pro-Nikita-2:xgun iscientist$ pip3 install setproctitle

然后我收到以下错误:

  Running setup.py bdist_wheel for setproctitle ... error
  Complete output from command /Users/iscientist/xgun/venv36/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/mq/ktmqb9m14p133g0sbykrgcr00000gq/T/pip-install-u0avfy7r/setproctitle/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 /private/var/folders/mq/ktmqb9m14p133g0sbykrgcr00000gq/T/pip-wheel-f8pukum1 --python-tag cp36:
  running bdist_wheel
  running build
  running build_ext
  building 'setproctitle' extension
  creating build
  creating build/temp.macosx-10.9-x86_64-3.6
  creating build/temp.macosx-10.9-x86_64-3.6/src
  gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Wno-error -DSPT_VERSION=1.1.10 -D__darwin__=1 -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/setproctitle.c -o build/temp.macosx-10.9-x86_64-3.6/src/setproctitle.o
  In file included from src/setproctitle.c:14:
  In file included from src/spt.h:15:
  In file included from src/spt_python.h:14:
  /Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m/Python.h:14:2: error: "Something's broken.  UCHAR_MAX should be defined in limits.h."
  #error "Something's broken.  UCHAR_MAX should be defined in limits.h."
   ^
  /Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m/Python.h:18:2: error: "Python's source code assumes C's unsigned char is an 8-bit type."
  #error "Python's source code assumes C's unsigned char is an 8-bit type."
   ^
  2 errors generated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for setproctitle

谷歌搜索数小时无济于事:(

我已经安装了最新版本的 Xcode 和 Xcode 命令行工具。

标签: pythonc++python-3.xmacospip

解决方案


推荐阅读