Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS Catalina 10.15.7] Failed to install - Unsupported architecture #1842

Closed
adithya604 opened this issue Oct 5, 2020 · 5 comments
Closed

Comments

@adithya604
Copy link

Platform

  • { macOS Catalina 10.15.7 }
  • { python version : 3.8 }

Bug description

Tried to install psutil using pip3 and found the following errors (pointers) to understand what the issue is:

  1. error: Unsupported architecture
  2. error: architecture not supported
  3. Many errors similar to error: unknown type name '__int32_t'; did you mean '__int128_t'?
  4. error: command 'xcrun' failed with exit status 1
  5. Wondering why all the files are copied to 10.14.6 location seeing this copying psutil/_psposix.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil.

Catalina is full 64 bit OS and there is no support for 32 bit. Not sure if this is the issue.

Full installation log

adithya.avvaru@xxxxx ~ % sudo pip3 install psutil  
Password:
Collecting psutil
  Downloading psutil-5.7.2.tar.gz (460 kB)
     |████████████████████████████████| 460 kB 987 kB/s 
Building wheels for collected packages: psutil
  Building wheel for psutil (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-671kdwiy/psutil/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-671kdwiy/psutil/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/tmp/pip-wheel-8hphg12u
       cwd: /private/tmp/pip-install-671kdwiy/psutil/
  Complete output (141 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14.6-x86_64-3.8
  creating build/lib.macosx-10.14.6-x86_64-3.8/psutil
  copying psutil/_pswindows.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
  copying psutil/_common.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
  copying psutil/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
  copying psutil/_psosx.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
  copying psutil/_psbsd.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
  copying psutil/_psaix.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
  copying psutil/_pslinux.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
  copying psutil/_compat.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
  copying psutil/_psposix.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
  copying psutil/_pssunos.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
  creating build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_contracts.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_connections.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/runner.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_unicode.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_misc.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_posix.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_linux.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_sunos.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_aix.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_process.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_bsd.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_system.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_osx.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_memleaks.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_windows.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/__main__.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  copying psutil/tests/test_testutils.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
  running build_ext
  building 'psutil._psutil_osx' extension
  creating build/temp.macosx-10.14.6-x86_64-3.8
  creating build/temp.macosx-10.14.6-x86_64-3.8/psutil
  creating build/temp.macosx-10.14.6-x86_64-3.8/psutil/arch
  creating build/temp.macosx-10.14.6-x86_64-3.8/psutil/arch/osx
  xcrun -sdk macosx 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 -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=572 -DPSUTIL_OSX=1 -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c psutil/_psutil_common.c -o build/temp.macosx-10.14.6-x86_64-3.8/psutil/_psutil_common.o
  In file included from psutil/_psutil_common.c:9:
  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 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/limits.h:63:
  /Applications/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
   ^
  In file included from psutil/_psutil_common.c:9:
  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 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/limits.h:64:
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from psutil/_psutil_common.c:9:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:33:
  /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 psutil/_psutil_common.c:9:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
  /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 psutil/_psutil_common.c:9:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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 psutil/_psutil_common.c:9:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:75:
  In file included from /Applications/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: error: architecture not supported
  #error architecture not supported
   ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  error: command 'xcrun' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for psutil
  Running setup.py clean for psutil
Failed to build psutil
Installing collected packages: psutil
    Running setup.py install for psutil ... error
    ERROR: Command errored out with exit status 1:
     command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-671kdwiy/psutil/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-671kdwiy/psutil/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/tmp/pip-record-admydyju/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Python/3.8/include/psutil
         cwd: /private/tmp/pip-install-671kdwiy/psutil/
    Complete output (141 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14.6-x86_64-3.8
    creating build/lib.macosx-10.14.6-x86_64-3.8/psutil
    copying psutil/_pswindows.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
    copying psutil/_common.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
    copying psutil/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
    copying psutil/_psosx.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
    copying psutil/_psbsd.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
    copying psutil/_psaix.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
    copying psutil/_pslinux.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
    copying psutil/_compat.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
    copying psutil/_psposix.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
    copying psutil/_pssunos.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil
    creating build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_contracts.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_connections.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/runner.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_unicode.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_misc.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_posix.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_linux.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_sunos.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_aix.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_process.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_bsd.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_system.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_osx.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_memleaks.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_windows.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/__main__.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    copying psutil/tests/test_testutils.py -> build/lib.macosx-10.14.6-x86_64-3.8/psutil/tests
    running build_ext
    building 'psutil._psutil_osx' extension
    creating build/temp.macosx-10.14.6-x86_64-3.8
    creating build/temp.macosx-10.14.6-x86_64-3.8/psutil
    creating build/temp.macosx-10.14.6-x86_64-3.8/psutil/arch
    creating build/temp.macosx-10.14.6-x86_64-3.8/psutil/arch/osx
    xcrun -sdk macosx 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 -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=572 -DPSUTIL_OSX=1 -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c psutil/_psutil_common.c -o build/temp.macosx-10.14.6-x86_64-3.8/psutil/_psutil_common.o
    In file included from psutil/_psutil_common.c:9:
    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 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/limits.h:63:
    /Applications/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
     ^
    In file included from psutil/_psutil_common.c:9:
    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 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/limits.h:64:
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported
    #error architecture not supported
     ^
    In file included from psutil/_psutil_common.c:9:
    In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:33:
    /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 psutil/_psutil_common.c:9:
    In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
    /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 psutil/_psutil_common.c:9:
    In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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 psutil/_psutil_common.c:9:
    In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:75:
    In file included from /Applications/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: error: architecture not supported
    #error architecture not supported
     ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: command 'xcrun' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-671kdwiy/psutil/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-671kdwiy/psutil/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/tmp/pip-record-admydyju/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Python/3.8/include/psutil Check the logs for full command output.

Test results

  • NA

Please let me know if you need any other information.

@adithya604 adithya604 added the bug label Oct 5, 2020
@mattdeluco
Copy link

I think the issue is related to -arch arm64 in the xcrun commands, rather than anything 32-bit related. I see the same issue trying to install psycopg2.

@adithya604
Copy link
Author

adithya604 commented Oct 6, 2020

Hi, Thanks for the quick reply. I got a different error when trying to install psycopg2 : Error: pg_config executable not found.. But there is a workaround provided to install using binary and the installation is successful. I don't see xcrun being used in the installation of psycopg2. Here is the installation log:

adithya.avvaru@xxxxx ~ % sudo pip3 install psycopg2
Password:
Collecting psycopg2
  Downloading psycopg2-2.8.6.tar.gz (383 kB)
     |████████████████████████████████| 383 kB 729 kB/s 
    ERROR: Command errored out with exit status 1:
     command: /Library/Developer/CommandLineTools/usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-7in82w1j/psycopg2/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-7in82w1j/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-dcgm6tyq
         cwd: /private/tmp/pip-install-7in82w1j/psycopg2/
    Complete output (23 lines):
    running egg_info
    creating /private/tmp/pip-pip-egg-info-dcgm6tyq/psycopg2.egg-info
    writing /private/tmp/pip-pip-egg-info-dcgm6tyq/psycopg2.egg-info/PKG-INFO
    writing dependency_links to /private/tmp/pip-pip-egg-info-dcgm6tyq/psycopg2.egg-info/dependency_links.txt
    writing top-level names to /private/tmp/pip-pip-egg-info-dcgm6tyq/psycopg2.egg-info/top_level.txt
    writing manifest file '/private/tmp/pip-pip-egg-info-dcgm6tyq/psycopg2.egg-info/SOURCES.txt'
    
    Error: pg_config executable not found.
    
    pg_config is required to build psycopg2 from source.  Please add the directory
    containing pg_config to the $PATH or specify the full executable path with the
    option:
    
        python setup.py build_ext --pg-config /path/to/pg_config build ...
    
    or with the pg_config option in 'setup.cfg'.
    
    If you prefer to avoid building psycopg2 from source, please install the PyPI
    'psycopg2-binary' package instead.
    
    For further information please check the 'doc/src/install.rst' file (also at
    <https://www.psycopg.org/docs/install.html>).
    
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

adithya.avvaru@TD-C02SG0G8G8WP ~ % sudo pip3 install psycopg2-binary
Collecting psycopg2-binary
  Downloading psycopg2_binary-2.8.6-cp38-cp38-macosx_10_9_x86_64.macosx_10_9_intel.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 680 kB/s 
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.8.6

I tried couple of things meanwhile:

  1. Installing xcode and then psutil as per https://github.com/giampaolo/psutil/blob/master/INSTALL.rst#macos.
  2. Installing from source as per https://github.com/giampaolo/psutil/blob/master/INSTALL.rst#install-from-sources.

Both didn't solve the issue.

Given that,

  1. Is this an environment issue that I can setup/fix?
  2. Is there any workaround to get this done?

I am heavily dependent on this package. Hence, looking to get some solution/workaround asap.
Appreciate your help.

@adithya604
Copy link
Author

@mattdeluco
macOS Catalina 10.15.7 have default python 3.8.2 and installing psutil in that python version is failing with the reported error.
It is reported in
https://stackoverflow.com/questions/64111015/pip-install-psutil-is-throwing-error-unsupported-architecture-any-workarou

When I installed anaconda, it comes with python 3.8.3. Looks like this is fixed and I could install psutils in conda environment.
I also tried installing latest python i.e. 3.9. psutil installation is successful here.
So, I think this issue is only for python 3.8.2. Since later version of python exists, you can close this issue.

Though installing psycogy2 is not installing from source in all the python3.x versions as mentioned in #1842 (comment), this is not related to psutil and you can consider closing this issue.

@NicolasNeubauer
Copy link

I can confirm, updating the global python3, in my case to 3.8.6, solves the issue.

@giampaolo
Copy link
Owner

It appears a solution has been provided for this, so I'm gonna close this issue.
Other than that, I just released psutil 5.8.0 which includes macOS wheels (see #1550 (comment)), so XCode should no longer be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants