Lỗi cài đặt PyAudio sau khi cập nhật lên Xcode 12

Sep 24 2020

Tôi đã được cập nhật lên Xcode 12, nhưng khi tôi cố gắng cài đặt PyAudio, tôi luôn gặp lỗi như sau: (Tôi cũng đã cố gắng cài đặt với sudo, có và không có venv, cũng bị lỗi như thế này ...)

  • Hệ điều hành: macOS 10.15.6 (19G2021)
  • Python: 3,8
  • Phiên bản Xcode: 12

Thu thập pyaudio Sử dụng PyAudio-0.2.11.tar.gz được lưu trong bộ nhớ cache (37 kB) Sử dụng 'setup.py install' kế thừa cho pyaudio, vì gói 'bánh xe' chưa được cài đặt. Cài đặt các gói đã thu thập: pyaudio Đang chạy setup.py cài đặt cho pyaudio ... lỗi LỖI: Lệnh bị lỗi với trạng thái thoát 1: lệnh: / Users / userid / Desktop / Workspace / Projects / hello-world / env / bin / python3 -u -c 'nhập sys, setuptools, mã hóa; sys.argv [0] = '"'" '/private/var/folders/dg/ppgz73fs3ml5zs4mxqtw_z_c0000gn/T/pip-install-qfayqnx7/pyaudio/setup.py' "'"'; file = '"'" '/ private / var / folder / dg / ppgz73fs3ml5zs4mxqtw_z_c0000gn / T / pip-install-qfayqnx7 / pyaudio / setup.py' "'"'; f = getattr (mã hóa, "" "" mở " "'"', open) ( file ); code = f.read (). Replace ('"'" '\ r \ n' "'"', '"'" '\ n' "'"); f.close (); thi hành (biên dịch (mã, tệp, "" "" "thi hành" "" ")) 'cài đặt --record /private/var/folders/dg/ppgz73fs3ml5zs4mxqtw_z_c0000gn/T/pip-record-8ls2_tdo/install-record.txt --single-version-externally -managed --compile --install-headers /Users/userid/Desktop/Workspace/Projects/hello-world/env/include/site/python3.8/pyaudio cwd: / private / var / folder / dg / ppgz73fs3ml5zs4mxqtw_z_c0000gn / T / pip-install-qfayqnx7 / pyaudio / Complete output (104 dòng): chạy cài đặt chạy bản dựng chạy bản build_py tạo bản dựng tạo bản dựng / lib.macosx-10.14.6-x86_64-3,8 sao chép src / pyaudio.py -> build / lib. macosx-10.14.6-x86_64-3.8 chạy tiện ích mở rộng build_ext building '_portaudio' tạo build / temp.macosx-10.14.6-x86_64-3.8 tạo build / temp.macosx-10.14.6-x86_64-3.8 / src xcrun -sdk macosx clang -Không-không-sử-dụng-kết-quả-thiết-kế-so-sánh -có thể-có-thể-mã-không-chung-động-động -DNDEBUG -g -fwrapv -O3-Tường -iwithsysroot / Hệ thống / Thư viện / Khung / System.framework / PrivateHeaders -iwithsysroot / Applications / Xcode.app/Contents/Developer/Library/Frameworks/Pyth on3.framework / Versions / 3.8 / Headers -arch arm64 -arch x86_64 -DMACOSX = 1 -I / Users / userid / Desktop / Workspace / Projects / hello-world / env / include-I / Applications / Xcode.app / Contents / Developer / Library / Frameworks / Python3.framework / Versions / 3.8 / include / python3.8 -c src / _portaudiomodule.c -o build / temp.macosx-10.14.6-x86_64-3.8 / src / _portaudiomodule.o Trong tệp bao gồm from src / _portaudiomodule.c: 27: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:68: /Application/Xcode.app/Contents/ Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.15.sdk / usr / include / sys / cdefs.h: 807: 2: error: Unsupported architecture #error Unsupported architecture ^ Trong tệp được bao gồm từ src / _portaudiomodule.c : 27: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platfor ms / MacOSX.platform / Developer / SDKs / MacOSX10.15.sdk / usr / include / stdio.h: 64: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs /MacOSX10.15.sdk/usr/include/_stdio.h:71: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/ include / _types.h: 27: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:33 : /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/machine/_types.h:34:2: error: architecture not support #error architecture không được hỗ trợ ^ Trong tệp được bao gồm từ src / _portaudiomodule.c: 27: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/ stdio.h: 64: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX .platform / Developer / SDKs / MacOSX10.15.sdk / usr / include / _stdio.h: 71: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10. 15.sdk / usr / include / _types.h: 27: /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h : 55: 9: error: tên kiểu không xác định '__int64_t' typedef __int64_t __darwin_blkcnt_t; / * tổng số khối / ^ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:56:9: lỗi: không xác định gõ tên '__int32_t'; ý bạn là '__int128_t'? typedef __int32_t __darwin_blksize_t; / kích thước khối ưa thích / ^ ghi chú: '__int128_t' được khai báo tại đây /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h: 57: 9: error: tên kiểu không xác định '__int32_t'; ý bạn là '__int128_t'? typedef __int32_t __darwin_dev_t; / dev_t / ^ lưu ý: '__int128_t' được khai báo ở đây /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:60: 9: error: tên kiểu không xác định '__uint32_t'; ý bạn là '__uint128_t'? typedef __uint32_t __darwin_gid_t; / [???] quy trình và ID nhóm / ^ ghi chú: '__uint128_t' được khai báo tại đây /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/ sys / _types.h: 61: 9: error: tên kiểu không xác định '__uint32_t'; ý bạn là '__uint128_t'? typedef __uint32_t __darwin_id_t; / [XSI] pid_t, uid_t hoặc gid_t * / ^ ghi chú: '__uint128_t' được khai báo tại đây /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include /sys/_types.h:62:9: error: tên loại không xác định '__uint64_t' typedef __uint64_t __darwin_ino64_t; / * [???] Được sử dụng cho các inode 64 bit/ ^ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:68:9: error: tên loại không xác định '__darwin_natural_t 'typedef __darwin_natural_t __darwin_mach_port_name_t; / Được sử dụng bởi mach / ^ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:70:9: error: không xác định tên gõ '__uint16_t'; ý bạn là '__uint128_t'? typedef __uint16_t __darwin_mode_t; / [???] Một số thuộc tính tệp / ^ note: '__uint128_t' được khai báo tại đây /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys /_types.h:71:9: error: tên loại không xác định '__int64_t' typedef __int64_t __darwin_off_t; / [???] Được sử dụng cho kích thước tệp / ^ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:72 : 9: error: tên kiểu không xác định '__int32_t'; ý bạn là '__int128_t'? typedef __int32_t __darwin_pid_t; / [???] quy trình và ID nhóm / ^ lưu ý: '__int128_t' được khai báo tại đây /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/ sys / _types.h: 73: 9: error: tên kiểu không xác định '__uint32_t'; ý bạn là '__uint128_t'? typedef __uint32_t __darwin_sigset_t; / [???] signal set / ^ note: '__uint128_t' được khai báo tại đây /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/ _types.h: 74: 9: error: tên kiểu không xác định '__int32_t'; ý bạn là '__int128_t'? typedef __int32_t __darwin_suseconds_t; / [???] micro giây / ^ note: '__int128_t' được khai báo ở đây /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types .h: 75: 9: error: tên kiểu không xác định '__uint32_t'; ý bạn là '__uint128_t'? typedef __uint32_t __darwin_uid_t; / [???] user ID / ^ note: '__uint128_t' được khai báo ở đây /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/ _types.h: 76: 9: error: tên kiểu không xác định '__uint32_t'; ý bạn là '__uint128_t'? typedef __uint32_t __darwin_useconds_t; / [???] micro giây * / ^ ghi chú: '__uint128_t' được khai báo ở đây Trong tệp được bao gồm từ src / _portaudiomodule.c: 27: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/ Developer / SDKs / MacOSX10.15.sdk / usr / include / stdio.h: 64: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk /usr/include/_stdio.h:71: /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_types.h:43:9: error: tên kiểu không xác định '__uint32_t'; ý bạn là '__uint128_t'? typedef __uint32_t __darwin_wctype_t; ^ note: '__uint128_t' được khai báo ở đây Trong tệp được bao gồm từ src / _portaudiomodule.c: 27: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk /usr/include/stdio.h:64: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h: 75: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_va_list.h:31: / Applications / Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/machine/types.h:37:2: lỗi: kiến ​​trúc không được hỗ trợ # kiến ​​trúc lỗi không được hỗ trợ ^ Trong tệp được bao gồm từ src / _portaudiomodule.c: 27: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdio.h: 64: Trong tệp được bao gồm từ /Application/Xcode.app/Contents/Develope r / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.15.sdk / usr / include / _stdio.h: 75: /Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10 .15.sdk / usr / include / sys / _types / _va_list.h: 32: 9: error: tên loại không xác định '__darwin_va_list' typedef __darwin_va_list va_list; ^ lỗi nghiêm trọng: đã tạo ra quá nhiều lỗi, hiện đang dừng [-ferror-limit =] Đã tạo 20 lỗi. error: lệnh 'xcrun' không thành công với trạng thái thoát 1 --------------------------------------- - LỖI: Lệnh bị lỗi với trạng thái thoát 1: / Users / userid / Desktop / Workspace / Projects / hello-world / env / bin / python3 -u -c 'import sys, setuptools, tokenize; sys.argv [0] = '"'" '/private/var/folders/dg/ppgz73fs3ml5zs4mxqtw_z_c0000gn/T/pip-install-qfayqnx7/pyaudio/setup.py' "'"'; file = '"'" '/ private / var / folder / dg / ppgz73fs3ml5zs4mxqtw_z_c0000gn / T / pip-install-qfayqnx7 / pyaudio / setup.py' "'"'; f = getattr (mã hóa, '"'" "mở" "'"', open) ( file ); code = f.read (). Replace ('"'" '\ r \ n' "'"', '"'" '\ n' "'"); f.close (); thi hành (biên dịch (mã, tệp , '"'" 'thực thi' '' '')) 'cài đặt --record / private / var / folder / dg / ppgz73fs3ml5zs4mxqtw_z_c0000gn / T / pip-record-8ls2_tdo /install-record.txt --single-version-externally-management --compile --install-headers /Users/userid/Desktop/Workspace/Projects/hello-world/env/include/site/python3.8/pyaudio Kiểm tra nhật ký cho đầu ra lệnh đầy đủ.

Bất cứ ai có thể giúp đỡ? cảm ơn!

Trả lời

7 japaniel Oct 07 2020 at 06:00

Tôi đã có thể giải quyết vấn đề này bằng cách xuất một biến môi trường

export ARCHFLAGS="-arch x86_64"