安装apache-airflow时出现错误:“无法构建setproctitle的wheels,该模块使用PEP 517并且不能直接安装”。

4
我正在尝试寻求安装apache-airflow的帮助。
我使用的是MacOS 10.15.7,Python版本为3.8.2,但是我一直收到以下错误提示:
ERROR: Could not build wheels for setproctitle which use PEP 517 and cannot be installed directly
我已经尝试使用较早版本的pip和python,但都没有成功。
有谁知道在这种情况下我该怎么做吗?我查看了所有与这些搜索词相关的stackoverflow问题,但至今没有一个解决方案适用于我。
非常感谢任何帮助。
>$ pip install apache-airflow
Collecting apache-airflow
  Using cached apache_airflow-2.0.1-py3-none-any.whl (4.5 MB)
Requirement already satisfied: pyjwt<2 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (1.7.1)
Collecting flask-caching<2.0.0,>=1.5.0
  Using cached Flask_Caching-1.9.0-py2.py3-none-any.whl (33 kB)
Requirement already satisfied: jinja2<2.12.0,>=2.10.1 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (2.10.3)
Requirement already satisfied: iso8601>=0.1.12 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (0.1.12)
Requirement already satisfied: cryptography>=0.9.3 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (3.4.6)
Requirement already satisfied: colorlog>=4.0.2 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (4.0.2)
Requirement already satisfied: unicodecsv>=0.14.1 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (0.14.1)
Collecting apache-airflow-providers-ftp
  Using cached apache_airflow_providers_ftp-1.0.1-py3-none-any.whl (14 kB)
Requirement already satisfied: dill<0.4,>=0.2.2 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (0.3.1.1)
Collecting sqlalchemy<2,>=1.3.18
  Using cached SQLAlchemy-1.3.23-cp38-cp38-macosx_10_14_x86_64.whl (1.2 MB)
Requirement already satisfied: alembic<2.0,>=1.2 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (1.4.2)
Collecting sqlalchemy-jsonfield~=1.0
  Using cached SQLAlchemy_JSONField-1.0.0-py3-none-any.whl (10 kB)
Collecting importlib-resources~=1.4
  Using cached importlib_resources-1.5.0-py2.py3-none-any.whl (21 kB)
Collecting requests>=2.20.0
  Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB)
Requirement already satisfied: python-dateutil<3,>=2.3 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (2.8.1)
Collecting apache-airflow-providers-imap
  Using cached apache_airflow_providers_imap-1.0.1-py3-none-any.whl (15 kB)
Requirement already satisfied: markupsafe<2.0,>=1.1.1 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (1.1.1)
Collecting python-slugify<5.0,>=3.0.0
  Using cached python_slugify-4.0.1-py2.py3-none-any.whl
Collecting python-daemon>=2.2.4
  Using cached python_daemon-2.3.0-py2.py3-none-any.whl (35 kB)
Collecting tenacity~=6.2.0
  Using cached tenacity-6.2.0-py2.py3-none-any.whl (24 kB)
Collecting flask-appbuilder~=3.1.1
  Using cached Flask_AppBuilder-3.1.1-py3-none-any.whl (1.7 MB)
Collecting cattrs~=1.1
  Using cached cattrs-1.3.0-py3-none-any.whl (18 kB)
Requirement already satisfied: flask-login<0.5,>=0.3 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (0.4.1)
Collecting setproctitle<2,>=1.1.8
  Using cached setproctitle-1.2.2.tar.gz (23 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting python3-openid~=3.2
  Using cached python3_openid-3.2.0-py3-none-any.whl (133 kB)
Collecting attrs<21.0,>=20.0
  Using cached attrs-20.3.0-py2.py3-none-any.whl (49 kB)
Collecting rich==9.2.0
  Using cached rich-9.2.0-py3-none-any.whl (164 kB)
Collecting werkzeug>=1.0.1,~=1.0
  Using cached Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
Requirement already satisfied: tabulate<0.9,>=0.7.5 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (0.8.6)
Requirement already satisfied: gunicorn<20.0,>=19.5.0 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (19.10.0)
Collecting python-nvd3~=0.15.0
  Using cached python_nvd3-0.15.0-py3-none-any.whl
Requirement already satisfied: importlib-metadata~=1.7 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (1.7.0)
Requirement already satisfied: lockfile>=0.12.2 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (0.12.2)
Collecting psutil<6.0.0,>=4.2.0
  Using cached psutil-5.8.0-cp38-cp38-macosx_10_9_x86_64.whl (236 kB)
Requirement already satisfied: croniter<0.4,>=0.3.17 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (0.3.31)
Collecting apache-airflow-providers-http
  Using cached apache_airflow_providers_http-1.1.0-py3-none-any.whl (20 kB)
Requirement already satisfied: pygments<3.0,>=2.0.1 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (2.6.1)
Requirement already satisfied: jsonschema~=3.0 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (3.2.0)
Requirement already satisfied: graphviz>=0.12 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (0.13.2)
Requirement already satisfied: argcomplete~=1.10 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (1.11.1)
Collecting connexion[flask,swagger-ui]<3,>=2.6.0
  Using cached connexion-2.7.0-py2.py3-none-any.whl (77 kB)
Requirement already satisfied: lazy-object-proxy in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (1.4.3)
Collecting apache-airflow-providers-sqlite
  Using cached apache_airflow_providers_sqlite-1.0.1-py3-none-any.whl (14 kB)
Collecting marshmallow-oneofschema>=2.0.1
  Using cached marshmallow_oneofschema-2.1.0-py2.py3-none-any.whl (5.7 kB)
Requirement already satisfied: termcolor>=1.1.0 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (1.1.0)
Collecting pendulum~=2.0
  Using cached pendulum-2.1.2-cp38-cp38-macosx_10_15_x86_64.whl (124 kB)
Requirement already satisfied: pandas<2.0,>=0.17.1 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (0.25.3)
Requirement already satisfied: markdown<4.0,>=2.5.2 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (2.6.11)
Requirement already satisfied: flask-wtf<0.15,>=0.14.3 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (0.14.3)
Requirement already satisfied: cached-property~=1.5 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (1.5.1)
Requirement already satisfied: flask<2.0,>=1.1.0 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (1.1.1)
Requirement already satisfied: itsdangerous>=1.1.0 in ./airflow-venv/lib/python3.8/site-packages (from apache-airflow) (1.1.0)
Requirement already satisfied: colorama<0.5.0,>=0.4.0 in ./airflow-venv/lib/python3.8/site-packages (from rich==9.2.0->apache-airflow) (0.4.3)
Collecting typing-extensions<4.0.0,>=3.7.4
  Using cached typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Collecting commonmark<0.10.0,>=0.9.0
  Using cached commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
Requirement already satisfied: Mako in ./airflow-venv/lib/python3.8/site-packages (from alembic<2.0,>=1.2->apache-airflow) (1.1.2)
Requirement already satisfied: python-editor>=0.3 in ./airflow-venv/lib/python3.8/site-packages (from alembic<2.0,>=1.2->apache-airflow) (1.0.4)
Requirement already satisfied: PyYAML>=5.1 in ./airflow-venv/lib/python3.8/site-packages (from connexion[flask,swagger-ui]<3,>=2.6.0->apache-airflow) (5.3.1)
Collecting openapi-spec-validator>=0.2.4
  Using cached openapi_spec_validator-0.3.0-py3-none-any.whl (31 kB)
Collecting inflection>=0.3.1
  Using cached inflection-0.5.1-py2.py3-none-any.whl (9.5 kB)
Collecting clickclick>=1.2
  Using cached clickclick-20.10.2-py2.py3-none-any.whl (7.4 kB)
Collecting swagger-ui-bundle>=0.0.2
  Using cached swagger_ui_bundle-0.0.8-py3-none-any.whl (3.8 MB)
Requirement already satisfied: click>=4.0 in ./airflow-venv/lib/python3.8/site-packages (from clickclick>=1.2->connexion[flask,swagger-ui]<3,>=2.6.0->apache-airflow) (6.7)
Requirement already satisfied: cffi>=1.12 in ./airflow-venv/lib/python3.8/site-packages (from cryptography>=0.9.3->apache-airflow) (1.14.5)
Requirement already satisfied: pycparser in ./airflow-venv/lib/python3.8/site-packages (from cffi>=1.12->cryptography>=0.9.3->apache-airflow) (2.20)
Collecting prison<1.0.0,>=0.1.3
  Using cached prison-0.1.3-py2.py3-none-any.whl (5.8 kB)
Requirement already satisfied: marshmallow-sqlalchemy<0.24.0,>=0.22.0 in ./airflow-venv/lib/python3.8/site-packages (from flask-appbuilder~=3.1.1->apache-airflow) (0.22.3)
Collecting apispec[yaml]<4,>=3.3
  Using cached apispec-3.3.2-py2.py3-none-any.whl (27 kB)
Requirement already satisfied: marshmallow<4,>=3 in ./airflow-venv/lib/python3.8/site-packages (from flask-appbuilder~=3.1.1->apache-airflow) (3.5.1)
Collecting email-validator<2,>=1.0.5
  Using cached email_validator-1.1.2-py2.py3-none-any.whl (17 kB)
Requirement already satisfied: marshmallow-enum<2,>=1.5.1 in ./airflow-venv/lib/python3.8/site-packages (from flask-appbuilder~=3.1.1->apache-airflow) (1.5.1)
Requirement already satisfied: Flask-JWT-Extended<4,>=3.18 in ./airflow-venv/lib/python3.8/site-packages (from flask-appbuilder~=3.1.1->apache-airflow) (3.24.1)
Requirement already satisfied: Flask-OpenID<2,>=1.2.5 in ./airflow-venv/lib/python3.8/site-packages (from flask-appbuilder~=3.1.1->apache-airflow) (1.2.5)
Requirement already satisfied: Flask-Babel<2,>=1 in ./airflow-venv/lib/python3.8/site-packages (from flask-appbuilder~=3.1.1->apache-airflow) (1.0.0)
Requirement already satisfied: Flask-SQLAlchemy<3,>=2.4 in ./airflow-venv/lib/python3.8/site-packages (from flask-appbuilder~=3.1.1->apache-airflow) (2.4.1)
Requirement already satisfied: sqlalchemy-utils<1,>=0.32.21 in ./airflow-venv/lib/python3.8/site-packages (from flask-appbuilder~=3.1.1->apache-airflow) (0.36.3)
Requirement already satisfied: idna>=2.0.0 in ./airflow-venv/lib/python3.8/site-packages (from email-validator<2,>=1.0.5->flask-appbuilder~=3.1.1->apache-airflow) (2.9)
Collecting dnspython>=1.15.0
  Using cached dnspython-2.1.0-py3-none-any.whl (241 kB)
Requirement already satisfied: pytz in ./airflow-venv/lib/python3.8/site-packages (from Flask-Babel<2,>=1->flask-appbuilder~=3.1.1->apache-airflow) (2019.3)
Requirement already satisfied: Babel>=2.3 in ./airflow-venv/lib/python3.8/site-packages (from Flask-Babel<2,>=1->flask-appbuilder~=3.1.1->apache-airflow) (2.8.0)
Requirement already satisfied: six in ./airflow-venv/lib/python3.8/site-packages (from Flask-JWT-Extended<4,>=3.18->flask-appbuilder~=3.1.1->apache-airflow) (1.14.0)
Requirement already satisfied: WTForms in ./airflow-venv/lib/python3.8/site-packages (from flask-wtf<0.15,>=0.14.3->apache-airflow) (2.2.1)
Requirement already satisfied: zipp>=0.5 in ./airflow-venv/lib/python3.8/site-packages (from importlib-metadata~=1.7->apache-airflow) (3.4.0)
Requirement already satisfied: setuptools in ./airflow-venv/lib/python3.8/site-packages (from jsonschema~=3.0->apache-airflow) (54.0.0)
Requirement already satisfied: pyrsistent>=0.14.0 in ./airflow-venv/lib/python3.8/site-packages (from jsonschema~=3.0->apache-airflow) (0.15.7)
Collecting openapi-schema-validator
  Using cached openapi_schema_validator-0.1.4-py3-none-any.whl (7.8 kB)
Requirement already satisfied: numpy>=1.13.3 in ./airflow-venv/lib/python3.8/site-packages (from pandas<2.0,>=0.17.1->apache-airflow) (1.18.2)
Collecting pytzdata>=2020.1
  Using cached pytzdata-2020.1-py2.py3-none-any.whl (489 kB)
Requirement already satisfied: docutils in ./airflow-venv/lib/python3.8/site-packages (from python-daemon>=2.2.4->apache-airflow) (0.16)
Collecting text-unidecode>=1.3
  Using cached text_unidecode-1.3-py2.py3-none-any.whl (78 kB)
Requirement already satisfied: defusedxml in ./airflow-venv/lib/python3.8/site-packages (from python3-openid~=3.2->apache-airflow) (0.6.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./airflow-venv/lib/python3.8/site-packages (from requests>=2.20.0->apache-airflow) (1.25.8)
Requirement already satisfied: chardet<5,>=3.0.2 in ./airflow-venv/lib/python3.8/site-packages (from requests>=2.20.0->apache-airflow) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in ./airflow-venv/lib/python3.8/site-packages (from requests>=2.20.0->apache-airflow) (2019.11.28)
Collecting isodate
  Using cached isodate-0.6.0-py2.py3-none-any.whl (45 kB)
Building wheels for collected packages: setproctitle
  Building wheel for setproctitle (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/orange/airflow_testing/airflow-venv/bin/python /Users/orange/airflow_testing/airflow-venv/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/gw/f5ssjh4s74x8m0dzzxdj09m40000gn/T/tmp1bbqxe6_
       cwd: /private/var/folders/gw/f5ssjh4s74x8m0dzzxdj09m40000gn/T/pip-install-slsvb38c/setproctitle_46b9decf51e14932ad0abe665916f05b
  Complete output (119 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'setproctitle' extension
  creating build
  creating build/temp.macosx-10.14.6-x86_64-3.8
  creating build/temp.macosx-10.14.6-x86_64-3.8/src
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -DSPT_VERSION=1.2.2 -D__darwin__=1 -I/Users/orange/airflow_testing/airflow-venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c src/setproctitle.c -o build/temp.macosx-10.14.6-x86_64-3.8/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:16:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/limits.h:21:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/limits.h:63:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
  #error Unsupported architecture
   ^
  In file included from src/setproctitle.c:14:
  In file included from src/spt.h:15:
  In file included from src/spt_python.h:16:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
  In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/limits.h:21:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/limits.h:64:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from src/setproctitle.c:14:
  In file included from src/spt.h:15:
  In file included from src/spt_python.h:16:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:33:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from src/setproctitle.c:14:
  In file included from src/spt.h:15:
  In file included from src/spt_python.h:16:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_dev_t;         /* dev_t */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'
  typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
  typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'; did you mean '__uint128_t'?
  typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
          ^
  note: '__uint128_t' declared here
  In file included from src/setproctitle.c:14:
  In file included from src/spt.h:15:
  In file included from src/spt_python.h:16:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_wctype_t;
          ^
  note: '__uint128_t' declared here
  In file included from src/setproctitle.c:14:
  In file included from src/spt.h:15:
  In file included from src/spt_python.h:16:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:75:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_va_list.h:31:
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
  #error architecture not supported
   ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for setproctitle
Failed to build setproctitle
ERROR: Could not build wheels for setproctitle which use PEP 517 and cannot be installed directly
3个回答

8
我在 MacOS 10.15.7 上,Python 版本为 3.8.2。我猜你使用的是预装于 macOS Catalina 中的 Python 3。
$ which python3
/usr/bin/python3

$ /usr/bin/python3 -V
Python 3.8.2

$ /usr/bin/python3 -m venv airflow-venv
$ source ./airflow-venv/bin/activate
(airflow-venv) $ python -V
Python 3.8.2
(airflow-venv) $ pip -V
pip 19.2.3 from /path/to/airflow-venv/lib/python3.8/site-packages/pip (python 3.8)
(airflow-venv) $ pip install apache-airflow

通过上述命令,我可以复现与以下内容有关的相同错误信息:

  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
  #error architecture not supported
   ^

捆绑的Python 3.8.2已知会在安装某些需要编译一些C代码的Python包时导致此类问题。使用其他来源提供的Python更好,以下是建议的来源: 请自行选择并确定哪个适合您。我个人使用Homebrew。
# Install Homebrew (https://brew.sh/)
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Python3.8
$ brew install python@3.8
$ brew link python@3.8

虽然目前最新的Python版本是3.9,但是apache-airflow的安装指南中提到支持哪些Python和pip版本:

请注意,关于Python 3的支持,Airflow 2.0.0已经测试过Python 3.6、3.7和3.8,但尚未支持Python 3.9。

由于最近(2020年11月)在解析器上进行了更改,因此目前仅官方支持20.2.4版本,但您可能会在20.3.3+版本上获得成功(待确认pip 20.3.0版本的所有初始问题是否已在20.3.3中修复)。为了安装Airflow,您需要将pip降级到版本20.2.4 pip install --upgrade pip==20.2.4

因此,请遵循这些建议:

$ which python3
/usr/local/bin/python3

$ python3 -V
Python 3.8.8

$ python3 -m venv airflow-venv
$ source ./airflow-venv/bin/activate
(airflow-venv) $ pip -V
pip 20.2.3 from /path/to/airflow-venv/lib/python3.8/site-packages/pip (python 3.8)
(airflow-venv) $ pip install --upgrade pip==20.2.4
...
      Successfully uninstalled pip-20.2.3
Successfully installed pip-20.2.4

然后就像以前一样安装apache-airflow

(airflow-venv) $ pip install apache-airflow

我在安装airflow时遇到了相同的问题,我尝试使用homebrew安装python,但是出现以下错误: brew install python@3.8 Error: python@3.8: the bottle needs the Apple Command Line Tools to be installed. You can install them, if desired, with: xcode-select --install 我已经在我的Mac上安装了Python 3.7和3.8,是否有任何方法可以使用它们来解决这个问题: which python3.8 /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 Rajnils-MacBook-Air:Airflow rajnilguha$ which python3.7 /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 - Rajnil Guha
@RajnilGuha 你尝试使用我回答底部的Python命令并在自己的Python安装中使用吗?或者你尝试遵循有关未安装"Apple Command Line Tools"错误的说明,然后安装它们了吗?如需进一步调试问题,请发布您自己的单独问题。 - Gino Mempin

0

尽管这是一个旧的线程,但我仍然看到XCode默认将Python3设置为Python3.8.2

安装过程中出现“错误架构不受支持”错误

首先,这个错误

  #error architecture not supported

在运行pip install之前,可以通过设置export ARCHFLAGS="-arch x86_64"来修复该问题。请记住,这里应该输入您的架构。可能旧的MacBook和新的M1 MacBook应该有不同的值。

Python3.8.2与setproctitle不兼容:_Py_GetArgcArgv错误

通过上述提到的提示,我成功安装了它。然而,就像 this topic中所提到的一样,Python 3.8.2setproctitle不兼容。 我遇到了

Python 3.8.2 (default, Aug 25 2020, 09:23:57) 
[Clang 12.0.0 (clang-1200.0.32.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import setproctitle
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(~/.venv/airflow_dev/lib/python3.8/site-packages/setproctitle.cpython-38-darwin.so, 2): Symbol not found: _Py_GetArgcArgv
  Referenced from: ~/.venv/airflow_dev/lib/python3.8/site-packages/setproctitle.cpython-38-darwin.so
  Expected in: flat namespace
 in ~/.venv/airflow_dev/lib/python3.8/site-packages/setproctitle.cpython-38-darwin.so

看起来最好的解决方案是将您的Python3.8版本升级到3.8.5或更高版本。


0

对我来说,出现了相同的错误 使用home-brew解决。可能是默认的python导致了问题。 同时为airflow使用支持的pip版本。我不得不降级pip版本

卸载pip-21.1.1: 成功卸载pip-21.1.1

成功安装pip-20.2.4 :)


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接