如何在Sierra中将构建系统从10.7升级到10.12?

时间:2017-04-24 22:30:17

标签: python macos build macos-sierra psutil

我正在尝试安装一个python包,它在构建psutils时失败并出现以下错误。

error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for psutil

在错误日志中,它似乎使用OSX 10.7的核心库,即使我使用的是Sierra 10.12。

creating build/lib.macosx-10.7-x86_64-3.6
  creating build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_common.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_compat.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_psbsd.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_pslinux.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_psosx.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_psposix.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_pssunos.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_pswindows.py -> build/lib.macosx-10.7-x86_64-3.6/psuti

确实提到了10.12 API可用。但我对升级构建系统一无所知。

/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h:53:34: error: 'introduced' undeclared here (not in a function)
         kCFISO8601DateFormatWithYear API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = (1UL << 0),

我有Anaconda Python 3.6和GCC 6.3.0。我在OSX 10.12.4上。

请按照下面的详细错误日志或访问github issue link

    Building wheels for collected packages: psutil
  Running setup.py bdist_wheel for psutil ... error
  Complete output from command /Users/akash/installations/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/t2/tg4jlfqn715g4p9_5yh1kzsc0000gn/T/pip-build-yw2o18bv/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 /var/folders/t2/tg4jlfqn715g4p9_5yh1kzsc0000gn/T/tmpjdqqg2odpip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.7-x86_64-3.6
  creating build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_common.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_compat.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_psbsd.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_pslinux.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_psosx.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_psposix.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_pssunos.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_pswindows.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  creating build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/runner.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_bsd.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_linux.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_memory_leaks.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_misc.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_osx.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_posix.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_process.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_sunos.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_system.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_windows.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  running build_ext
  building 'psutil._psutil_osx' extension
  creating build/temp.macosx-10.7-x86_64-3.6
  creating build/temp.macosx-10.7-x86_64-3.6/psutil
  creating build/temp.macosx-10.7-x86_64-3.6/psutil/arch
  creating build/temp.macosx-10.7-x86_64-3.6/psutil/arch/osx
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/akash/installations/anaconda3/include -arch x86_64 -I/Users/akash/installations/anaconda3/include -arch x86_64 -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=501 -DPSUTIL_OSX=1 -I/Users/akash/installations/anaconda3/include/python3.6m -c psutil/_psutil_osx.c -o build/temp.macosx-10.7-x86_64-3.6/psutil/_psutil_osx.o
  In file included from /usr/include/Availability.h:190:0,
                   from /usr/include/stdio.h:65,
                   from /Users/akash/installations/anaconda3/include/python3.6m/Python.h:25,
                   from psutil/_psutil_osx.c:9:
  /System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h:53:34: error: 'introduced' undeclared here (not in a function)
       kCFISO8601DateFormatWithYear API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = (1UL << 0),
                                    ^
  /System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:777:39: error: 'deprecated' undeclared here (not in a function)
   const CFStringRef kCFURLLabelColorKey API_DEPRECATED("Use NSURLLabelColorKey", macosx(10.6, 10.12), ios(4.0, 10.0), watchos(2.0, 3.0), tvos(9.0, 10.0));
                                         ^
  /System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:777:39: error: 'message' undeclared here (not in a function)
   const CFStringRef kCFURLLabelColorKey API_DEPRECATED("Use NSURLLabelColorKey", macosx(10.6, 10.12), ios(4.0, 10.0), watchos(2.0, 3.0), tvos(9.0, 10.0));
                                         ^
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for psutil
  Running setup.py clean for psutil
Failed to build psutil
Installing collected packages: psutil, blessings, requests, stevedore, bonobo
  Found existing installation: psutil 5.1.3
    DEPRECATION: Uninstalling a distutils installed project (psutil) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling psutil-5.1.3:
      Successfully uninstalled psutil-5.1.3
  Running setup.py install for psutil ... error
    Complete output from command /Users/akash/installations/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/t2/tg4jlfqn715g4p9_5yh1kzsc0000gn/T/pip-build-yw2o18bv/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 /var/folders/t2/tg4jlfqn715g4p9_5yh1kzsc0000gn/T/pip-m1qlazv0-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.6
    creating build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_common.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_compat.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_psbsd.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_pslinux.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_psosx.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_psposix.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_pssunos.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_pswindows.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    creating build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/runner.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_bsd.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_linux.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_memory_leaks.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_misc.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_osx.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_posix.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_process.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_sunos.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_system.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_windows.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    running build_ext
    building 'psutil._psutil_osx' extension
    creating build/temp.macosx-10.7-x86_64-3.6
    creating build/temp.macosx-10.7-x86_64-3.6/psutil
    creating build/temp.macosx-10.7-x86_64-3.6/psutil/arch
    creating build/temp.macosx-10.7-x86_64-3.6/psutil/arch/osx
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/akash/installations/anaconda3/include -arch x86_64 -I/Users/akash/installations/anaconda3/include -arch x86_64 -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=501 -DPSUTIL_OSX=1 -I/Users/akash/installations/anaconda3/include/python3.6m -c psutil/_psutil_osx.c -o build/temp.macosx-10.7-x86_64-3.6/psutil/_psutil_osx.o
    In file included from /usr/include/Availability.h:190:0,
                     from /usr/include/stdio.h:65,
                     from /Users/akash/installations/anaconda3/include/python3.6m/Python.h:25,
                     from psutil/_psutil_osx.c:9:
    /System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h:53:34: error: 'introduced' undeclared here (not in a function)
         kCFISO8601DateFormatWithYear API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = (1UL << 0),
                                      ^
    /System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:777:39: error: 'deprecated' undeclared here (not in a function)
     const CFStringRef kCFURLLabelColorKey API_DEPRECATED("Use NSURLLabelColorKey", macosx(10.6, 10.12), ios(4.0, 10.0), watchos(2.0, 3.0), tvos(9.0, 10.0));
                                           ^
    /System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:777:39: error: 'message' undeclared here (not in a function)
     const CFStringRef kCFURLLabelColorKey API_DEPRECATED("Use NSURLLabelColorKey", macosx(10.6, 10.12), ios(4.0, 10.0), watchos(2.0, 3.0), tvos(9.0, 10.0));
                                           ^
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
  Rolling back uninstall of psutil
Command "/Users/akash/installations/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/t2/tg4jlfqn715g4p9_5yh1kzsc0000gn/T/pip-build-yw2o18bv/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 /var/folders/t2/tg4jlfqn715g4p9_5yh1kzsc0000gn/T/pip-m1qlazv0-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/t2/tg4jlfqn715g4p9_5yh1kzsc0000gn/T/pip-build-yw2o18bv/psutil/

0 个答案:

没有答案