Issues

Issue #66 resolved

'Cannot locate a working compiler' error when installing PyObjC

John Colgrove
created an issue

Sorry in advance for the long post but every time I try to install PyObjC with either Easy Install or pip it seems to end prematurely. Here is the output:

$ easy_install -U pyobjc-core Searching for pyobjc-core Reading https://pypi.python.org/simple/pyobjc-core/ Best match: pyobjc-core 2.5.1 Downloading https://pypi.python.org/packages/source/p/pyobjc-core/pyobjc-core-2.5.1.tar.gz#md5=931c6cfb040df0d7e26c0898886380cf Processing pyobjc-core-2.5.1.tar.gz Writing /var/folders/m0/8bxc3spn2pjc525q0xcvrz3m0000gn/T/easy_install-eofjyC/pyobjc-core-2.5.1/setup.cfg Running pyobjc-core-2.5.1/setup.py -q bdist_egg --dist-dir /var/folders/m0/8bxc3spn2pjc525q0xcvrz3m0000gn/T/easy_install-eofjyC/pyobjc-core-2.5.1/egg-dist-tmp-Sx9_m1 warning: no directories found matching 'Scripts' warning: no directories found matching 'setup-lib' warning: no directories found matching 'source-deps' warning: no previously-included files matching '.DS_Store' found anywhere in distribution warning: no previously-included files matching '.pyc' found anywhere in distribution warning: no previously-included files matching '.so' found anywhere in distribution error: Setup script exited with Cannot locate a working compiler

I have no idea what's causing this error, or even if it did work and I'm just being stupid (god swallow me whole if I am being stupid...lol). I should note that I have both Xcode and the command line tools installed and updated to the latest version so we can probably knock that out of the way.

I also tried this: $ env CC=clang easy_install -U pyobjc-core

and got this:

Searching for pyobjc-core Reading https://pypi.python.org/simple/pyobjc-core/ Best match: pyobjc-core 2.5.1 Downloading https://pypi.python.org/packages/source/p/pyobjc-core/pyobjc-core-2.5.1.tar.gz#md5=931c6cfb040df0d7e26c0898886380cf Processing pyobjc-core-2.5.1.tar.gz Writing /var/folders/m0/8bxc3spn2pjc525q0xcvrz3m0000gn/T/easy_install-XI_JoC/pyobjc-core-2.5.1/setup.cfg Running pyobjc-core-2.5.1/setup.py -q bdist_egg --dist-dir /var/folders/m0/8bxc3spn2pjc525q0xcvrz3m0000gn/T/easy_install-XI_JoC/pyobjc-core-2.5.1/egg-dist-tmp-mJTNuY warning: no directories found matching 'Scripts' warning: no directories found matching 'setup-lib' warning: no directories found matching 'source-deps' warning: no previously-included files matching '.DS_Store' found anywhere in distribution warning: no previously-included files matching '.pyc' found anywhere in distribution warning: no previously-included files matching '.so' found anywhere in distribution clang: warning: not using the clang compiler for the 'powerpc' architecture llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory clang: error: gcc frontend command failed with exit code 255 (use -v to see invocation) error: Setup script exited with error: command 'clang' failed with exit status 255

Comments (13)

  1. Ronald Oussoren repo owner

    Do you have the Xcode Command-Line tools installed on your system? And is it up-to-date (start Xcode and check the software downloads page in its preferences).

  2. Ronald Oussoren repo owner

    I just noticed that the compiler tries to build support for the powerpc architecture, but doesn't support that. What version of Python do you use?

    A quick thing to try:

    $ env ARCHFLAGS="-arch i386" easy_install -U pyobjc-core
    

    This compiles the binary for intel (32-bit) only.

  3. John Colgrove reporter

    I use python 3.3 and python 2.7. I tried that but it failed miserably. Here is the output:

    $ env ARCHFLAGS="-arch i386" easy_install -U pyobjc-core
    Searching for pyobjc-core
    Reading https://pypi.python.org/simple/pyobjc-core/
    Best match: pyobjc-core 2.5.1
    Downloading https://pypi.python.org/packages/source/p/pyobjc-core/pyobjc-core-2.5.1.tar.gz#md5=931c6cfb040df0d7e26c0898886380cf
    Processing pyobjc-core-2.5.1.tar.gz
    Writing /var/folders/m0/8bxc3spn2pjc525q0xcvrz3m0000gn/T/easy_install-kehNyr/pyobjc-core-2.5.1/setup.cfg
    Running pyobjc-core-2.5.1/setup.py -q bdist_egg --dist-dir /var/folders/m0/8bxc3spn2pjc525q0xcvrz3m0000gn/T/easy_install-kehNyr/pyobjc-core-2.5.1/egg-dist-tmp-8LlI9S
    warning: no directories found matching 'Scripts'
    warning: no directories found matching 'setup-lib'
    warning: no directories found matching 'source-deps'
    warning: no previously-included files matching '.DS_Store' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    Use '/usr/bin/clang' instead of 'gcc-4.0' as the compiler
    Modules/objc/formal-protocol.m:551:1: warning: missing field 'as_number'
          initializer [-Wmissing-field-initializers]
    };
    ^
    1 warning generated.
    Modules/objc/fsref.m:212:1: warning: missing field 'as_number' initializer
          [-Wmissing-field-initializers]
    };
    ^
    1 warning generated.
    Modules/objc/fsspec.m:138:1: warning: missing field 'as_number' initializer
          [-Wmissing-field-initializers]
    };
    ^
    1 warning generated.
    Modules/objc/function.m:334:1: warning: missing field 'as_number' initializer
          [-Wmissing-field-initializers]
    };
    ^
    1 warning generated.
    Modules/objc/informal-protocol.m:233:1: warning: missing field 'as_number'
          initializer [-Wmissing-field-initializers]
    };
    ^
    1 warning generated.
    Modules/objc/instance-var.m:453:1: warning: missing field 'as_number'
          initializer [-Wmissing-field-initializers]
    };
    ^
    1 warning generated.
    Modules/objc/method-accessor.m:468:1: warning: missing field 'as_number'
          initializer [-Wmissing-field-initializers]
    };
    ^
    1 warning generated.
    Modules/objc/method-imp.m:352:1: warning: missing field 'as_number' initializer
          [-Wmissing-field-initializers]
    };
    ^
    1 warning generated.
    Modules/objc/method-signature.m:97:1: warning: missing field 'as_number'
          initializer [-Wmissing-field-initializers]
    };
    ^
    1 warning generated.
    Modules/objc/objc-class.m:1623:1: warning: missing field 'as_number' initializer
          [-Wmissing-field-initializers]
    };
    ^
    1 warning generated.
    Modules/objc/objc-NULL.m:66:1: warning: missing field 'as_number' initializer
          [-Wmissing-field-initializers]
    };
    ^
    1 warning generated.
    Modules/objc/objc-object.m:837:24: warning: excess elements in scalar
          initializer
            PyVarObject_HEAD_INIT(&PyObjCClass_Type, 0)
                                  ^~~~~~~~~~~~~~~~~
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:91:24: note: 
          expanded from macro 'PyVarObject_HEAD_INIT'
        PyObject_HEAD_INIT(type) size,
                           ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:88:8: note: 
          expanded from macro 'PyObject_HEAD_INIT'
        1, type,
           ^
    Modules/objc/objc-object.m:892:11: warning: excess elements in scalar
          initializer
         { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
              ^
    Modules/objc/objc-object.m:898:11: warning: excess elements in scalar
          initializer
         { 0, 0, 0 },                       /* as_mapping */
              ^
    Modules/objc/objc-object.m:899:11: warning: excess elements in scalar
          initializer
         { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },  /* as_sequence */
              ^
    Modules/objc/objc-object.m:900:11: warning: excess elements in scalar
          initializer
         { 0, 0, 0, 0 
              ^
    Modules/objc/objc-object.m:923:4: warning: missing field 'tp_print' initializer
          [-Wmissing-field-initializers]
       }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
       ^
    6 warnings generated.
    Modules/objc/objc_super.m:177:1: warning: missing field 'as_number' initializer
          [-Wmissing-field-initializers]
    };
    ^
    1 warning generated.
    Modules/objc/ObjCPointer.m:134:1: warning: missing field 'as_number' initializer
          [-Wmissing-field-initializers]
    };
    ^
    1 warning generated.
    Modules/objc/opaque-pointer.m:247:11: error: no member named 'ht_type' in
          'struct _typeobject'; did you mean 'ob_type'?
            newType->ht_type.tp_basicsize = sizeof(OpaquePointerObject);
                     ^~~~~~~
                     ob_type
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:329:5: note: 
          'ob_type' declared here
        PyObject_VAR_HEAD
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:100:5: note: 
          expanded from macro 'PyObject_VAR_HEAD'
        PyObject_HEAD                       \
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:84:25: note: 
          expanded from macro 'PyObject_HEAD'
        struct _typeobject *ob_type;
                            ^
    Modules/objc/opaque-pointer.m:247:18: error: member reference type
          'struct _typeobject *' is a pointer; maybe you meant to use '->'?
            newType->ht_type.tp_basicsize = sizeof(OpaquePointerObject);
            ~~~~~~~~~~~~~~~~^
                            ->
    Modules/objc/opaque-pointer.m:248:11: error: no member named 'ht_type' in
          'struct _typeobject'; did you mean 'ob_type'?
            newType->ht_type.tp_dealloc = opaque_dealloc;
                     ^~~~~~~
                     ob_type
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:329:5: note: 
          'ob_type' declared here
        PyObject_VAR_HEAD
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:100:5: note: 
          expanded from macro 'PyObject_VAR_HEAD'
        PyObject_HEAD                       \
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:84:25: note: 
          expanded from macro 'PyObject_HEAD'
        struct _typeobject *ob_type;
                            ^
    Modules/objc/opaque-pointer.m:248:18: error: member reference type
          'struct _typeobject *' is a pointer; maybe you meant to use '->'?
            newType->ht_type.tp_dealloc = opaque_dealloc;
            ~~~~~~~~~~~~~~~~^
                            ->
    Modules/objc/opaque-pointer.m:249:11: error: no member named 'ht_type' in
          'struct _typeobject'; did you mean 'ob_type'?
            newType->ht_type.tp_getattro = PyObject_GenericGetAttr;
                     ^~~~~~~
                     ob_type
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:329:5: note: 
          'ob_type' declared here
        PyObject_VAR_HEAD
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:100:5: note: 
          expanded from macro 'PyObject_VAR_HEAD'
        PyObject_HEAD                       \
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:84:25: note: 
          expanded from macro 'PyObject_HEAD'
        struct _typeobject *ob_type;
                            ^
    Modules/objc/opaque-pointer.m:249:18: error: member reference type
          'struct _typeobject *' is a pointer; maybe you meant to use '->'?
            newType->ht_type.tp_getattro = PyObject_GenericGetAttr;
            ~~~~~~~~~~~~~~~~^
                            ->
    Modules/objc/opaque-pointer.m:250:11: error: no member named 'ht_type' in
          'struct _typeobject'; did you mean 'ob_type'?
            newType->ht_type.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HEAPTYPE;
                     ^~~~~~~
                     ob_type
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:329:5: note: 
          'ob_type' declared here
        PyObject_VAR_HEAD
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:100:5: note: 
          expanded from macro 'PyObject_VAR_HEAD'
        PyObject_HEAD                       \
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:84:25: note: 
          expanded from macro 'PyObject_HEAD'
        struct _typeobject *ob_type;
                            ^
    Modules/objc/opaque-pointer.m:250:18: error: member reference type
          'struct _typeobject *' is a pointer; maybe you meant to use '->'?
            newType->ht_type.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HEAPTYPE;
            ~~~~~~~~~~~~~~~~^
                            ->
    Modules/objc/opaque-pointer.m:251:11: error: no member named 'ht_type' in
          'struct _typeobject'; did you mean 'ob_type'?
            newType->ht_type.tp_methods = opaque_methods;
                     ^~~~~~~
                     ob_type
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:329:5: note: 
          'ob_type' declared here
        PyObject_VAR_HEAD
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:100:5: note: 
          expanded from macro 'PyObject_VAR_HEAD'
        PyObject_HEAD                       \
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:84:25: note: 
          expanded from macro 'PyObject_HEAD'
        struct _typeobject *ob_type;
                            ^
    Modules/objc/opaque-pointer.m:251:18: error: member reference type
          'struct _typeobject *' is a pointer; maybe you meant to use '->'?
            newType->ht_type.tp_methods = opaque_methods;
            ~~~~~~~~~~~~~~~~^
                            ->
    Modules/objc/opaque-pointer.m:252:11: error: no member named 'ht_type' in
          'struct _typeobject'; did you mean 'ob_type'?
            newType->ht_type.tp_members = opaque_members;
                     ^~~~~~~
                     ob_type
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:329:5: note: 
          'ob_type' declared here
        PyObject_VAR_HEAD
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:100:5: note: 
          expanded from macro 'PyObject_VAR_HEAD'
        PyObject_HEAD                       \
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:84:25: note: 
          expanded from macro 'PyObject_HEAD'
        struct _typeobject *ob_type;
                            ^
    Modules/objc/opaque-pointer.m:252:18: error: member reference type
          'struct _typeobject *' is a pointer; maybe you meant to use '->'?
            newType->ht_type.tp_members = opaque_members;
            ~~~~~~~~~~~~~~~~^
                            ->
    Modules/objc/opaque-pointer.m:253:11: error: no member named 'ht_type' in
          'struct _typeobject'; did you mean 'ob_type'?
            newType->ht_type.tp_new = opaque_new;
                     ^~~~~~~
                     ob_type
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:329:5: note: 
          'ob_type' declared here
        PyObject_VAR_HEAD
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:100:5: note: 
          expanded from macro 'PyObject_VAR_HEAD'
        PyObject_HEAD                       \
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:84:25: note: 
          expanded from macro 'PyObject_HEAD'
        struct _typeobject *ob_type;
                            ^
    Modules/objc/opaque-pointer.m:253:18: error: member reference type
          'struct _typeobject *' is a pointer; maybe you meant to use '->'?
            newType->ht_type.tp_new = opaque_new;
            ~~~~~~~~~~~~~~~~^
                            ->
    Modules/objc/opaque-pointer.m:255:11: error: no member named 'ht_type' in
          'struct _typeobject'; did you mean 'ob_type'?
            newType->ht_type.tp_as_number = &newType->as_number;
                     ^~~~~~~
                     ob_type
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:329:5: note: 
          'ob_type' declared here
        PyObject_VAR_HEAD
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:100:5: note: 
          expanded from macro 'PyObject_VAR_HEAD'
        PyObject_HEAD                       \
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:84:25: note: 
          expanded from macro 'PyObject_HEAD'
        struct _typeobject *ob_type;
                            ^
    Modules/objc/opaque-pointer.m:255:18: error: member reference type
          'struct _typeobject *' is a pointer; maybe you meant to use '->'?
            newType->ht_type.tp_as_number = &newType->as_number;
            ~~~~~~~~~~~~~~~~^
                            ->
    Modules/objc/opaque-pointer.m:256:11: error: no member named 'ht_type' in
          'struct _typeobject'; did you mean 'ob_type'?
            newType->ht_type.tp_as_mapping = &newType->as_mapping;
                     ^~~~~~~
                     ob_type
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:329:5: note: 
          'ob_type' declared here
        PyObject_VAR_HEAD
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:100:5: note: 
          expanded from macro 'PyObject_VAR_HEAD'
        PyObject_HEAD                       \
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:84:25: note: 
          expanded from macro 'PyObject_HEAD'
        struct _typeobject *ob_type;
                            ^
    Modules/objc/opaque-pointer.m:256:18: error: member reference type
          'struct _typeobject *' is a pointer; maybe you meant to use '->'?
            newType->ht_type.tp_as_mapping = &newType->as_mapping;
            ~~~~~~~~~~~~~~~~^
                            ->
    Modules/objc/opaque-pointer.m:257:11: error: no member named 'ht_type' in
          'struct _typeobject'; did you mean 'ob_type'?
            newType->ht_type.tp_as_sequence = &newType->as_sequence;
                     ^~~~~~~
                     ob_type
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:329:5: note: 
          'ob_type' declared here
        PyObject_VAR_HEAD
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:100:5: note: 
          expanded from macro 'PyObject_VAR_HEAD'
        PyObject_HEAD                       \
        ^
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:84:25: note: 
          expanded from macro 'PyObject_HEAD'
        struct _typeobject *ob_type;
                            ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1
    
  4. John Colgrove reporter

    I just thought of something. Could the error be a result from having two different versions of python 2.7 installed? More specifically, the version of python that comes preinstalled and python 2.7.5 directly from python's website?

    Also, I updated my OS to 10.8.5 and updated to xcode 5 with the updated command-line tools and it doesn't appear to have changed very much. Would you like to see that log too?

  5. Malay Keshav

    Having the same issue on 10.9.2 xCode and Command Line Tools updated recently.

    Here is the log for manual instal :

    sudo python setup.py install
    Password:
    running install
    Checking .pth file support in /Library/Python/2.7/site-packages/
    /usr/bin/python -E -c pass
    TEST PASSED: /Library/Python/2.7/site-packages/ appears to support .pth files
    running bdist_egg
    running egg_info
    writing include/pyobjc-compat.h to Lib/pyobjc_core.egg-info/include/pyobjc-compat.h
    writing include/pyobjc-api.h to Lib/pyobjc_core.egg-info/include/pyobjc-api.h
    writing Lib/pyobjc_core.egg-info/PKG-INFO
    writing namespace_packages to Lib/pyobjc_core.egg-info/namespace_packages.txt
    writing top-level names to Lib/pyobjc_core.egg-info/top_level.txt
    writing dependency_links to Lib/pyobjc_core.egg-info/dependency_links.txt
    reading manifest file 'Lib/pyobjc_core.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no directories found matching 'Scripts'
    warning: no directories found matching 'setup-lib'
    warning: no directories found matching 'source-deps'
    warning: no previously-included files matching '.DS_Store' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    writing manifest file 'Lib/pyobjc_core.egg-info/SOURCES.txt'
    installing library code to build/bdist.macosx-10.9-intel/egg
    running install_lib
    running build_py
    Overriding build_packages to copy PyObjCTest
    running build_ext
    Cannot locate a working compiler
    
  6. sfroid sfroid

    The reason for the fail now is that xcode 5.1 has converted some previous warnings (invalid command line arguments) into errors

    While we wait for the devs to fix the broken command line arguments, there is a way to make xcode consider the extra arguments as warnings.

    The following command should work for installing pyobjc-core

    ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future easy_install -U pyobjc-core
    

    and similar command for pyobjc.

  7. Isaac SUN
    ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future easy_install -U pyobjc-core
    

    does help to solve the problem, Thanks!

  8. Log in to comment