在 MacOSX python 3.8 上安装 python-qpid-proton 失败

Installing python-qpid-proton fails on MacOSX python 3.8

这以前没有发生过,所以我不知道过去几个月发生了什么变化,但不幸的是我发现自己不得不重新安装 python- qpid-proton,现在我 运行 遇到错误,我根本找不到好的修复方法。

问题

如果我运行下面一行:

pip install python-qpid-proton

我得到以下全部为红色的输出:

    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
    #error architecture not supported
     ^
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/src/core/log.c:20:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/src/core/log_private.h:27:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/log.h:23:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/logger.h:32:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/object.h:26:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/types.h:27:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/type_compat.h:75:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/types.h:79:
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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 */
            ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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 */
            ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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 */
            ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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 */
            ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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 /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/src/core/log.c:20:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/src/core/log_private.h:27:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/log.h:23:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/logger.h:32:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/object.h:26:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/types.h:27:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/type_compat.h:75:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/types.h:81:
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/machine/endian.h:37:2: error: architecture not supported
    #error architecture not supported
     ^
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/src/core/log.c:20:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/src/core/log_private.h:27:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/log.h:23:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/logger.h:32:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/object.h:26:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/types.h:27:
    In file included from /private/var/folders/l_/y17fz4qs6mn4wvdb781hnn50dbr4xv/T/pip-install-01kp069a/python-qpid-proton/include/proton/type_compat.h:75:
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/types.h:95:9: error: unknown type name 'u_int64_t'
    typedef u_int64_t               u_quad_t;       /* quads */
            ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: command 'xcrun' failed with exit status 1

我不确定此时我应该做什么,或者我是否应该去找创作者并报告这件事。任何帮助将不胜感激。

环境 - 编辑

我使用 Python 3.7,现在是 3.8。我已经使用自制软件安装了它。 我不使用 OSX 版本,即 python 2.7。 我还使用 virtualenv 为 python 应用程序创建环境.我必须重新安装 qpid 的原因是,如果我让我的解决方案静置一段时间(处理其他事情),然后我再回来使用它,它就会崩溃。我认为原因是我使用 brew update 无意中将 python 从 3.7 更新到 3.8。我可能不应该这样做。这破坏了 virtualenv 使用 python3.7.

如您所知,我为我的应用程序使用虚拟环境。我正在使用 3.8 python,当我在我的虚拟环境中 运行ning pip install 上述问题发生。

谢谢,

您使用的是什么 python 和环境? ...如果您不知道,您可能只是在 OSX.

上使用 standard/default python

您可能 a) 不想使用它并且 b) 不想尝试将新模块安装到其中,因为它被 OS 使用,安装到系统中 space,不是最新的 python 版本,很难作为用户项目使用。

如果您还没有,您应该尝试使用 python distribution/package 管理器。我个人使用Conda。

如果你使用它,你可能不会 运行 遇到你在这里看到的问题类型。

嗯! Qpid Proton 看起来不适用于 3.8。 3.7.8 安装 Qpid Proton 就好了。

作为解决方案,我不得不绕过自制软件并使用 pyenv。

使用 pyenv 的目录和 virtualenv,我能够成功 re-install qpid 和 运行 应用程序。我仍然需要回去清理自制软件并完全摆脱那个生态圈中的 python,这样我就可以使用 pyenv 来控制它。本质上,当 brew 更新到 3.8(我不知道)时,它破坏了我的代码。返回并通过自制软件降级似乎很昂贵,所以我选择使用另一个 python 环境工具。

所以,如果您使用的是 Apache 的 Qpid Proton,请不要升级到 3.8。