5

I've been working on a python script, first using the Psychopy compiler, which already included all I needed, but now I need to make it the more independent as possible. I have the script working on a Windows computer, but I also want it to work in OSX.

The script uses pyglet and I followed this post in order to install it. However, when I reach the latest step, which is installing PyObjc, I have the following error:

40 warnings and 1 error generated.

error: command '/usr/bin/clang' failed with exit status 1

----------------------------------------
Cleaning up...
Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools, tokenize;__file__='/private/var/folders/fk/1plt8wj53_d183pv59scmg4m0000gn/T/pip_build_JL/pyobjc-core/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/fk/1plt8wj53_d183pv59scmg4m0000gn/T/pip-HfEjaW-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/fk/1plt8wj53_d183pv59scmg4m0000gn/T/pip_build_JL/pyobjc-core
Storing debug log for failure in /Users/JL/.pip/pip.log

Why does this error appears? What can I do to solve it?

Neelu S
  • 47
  • 1
  • 11
jl.da
  • 627
  • 1
  • 11
  • 30
  • For Apple M1 doubts, see other answers like: https://stackoverflow.com/a/66771944/1736679 – Efren May 23 '22 at 05:09

2 Answers2

7

Terminal post:

xcode-select --install

may be can help you.

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
iamct
  • 394
  • 5
  • 9
  • "40 warnings and 1 error generated." This means `clang` has been installed but failed to compile the code. – Siyuan Ren Sep 04 '14 at 01:33
  • 2
    yesterday,when i 'pip install lxml ',the same error occured. after 'xcode-select --install' ,that/s ok. – iamct Sep 04 '14 at 02:16
1

Try installing pyobjc separately first.

On OSX 10.7 or 10.8, try:

env CC=clang pip -U pyobjc-core
env CC=clang pip -U pyobjc

On OSX 10.9, try:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pyobjc
chishaku
  • 4,577
  • 3
  • 25
  • 33
  • The latter gives me the following on 10.9: warning: unknown warning option '-Werror=unused-command-line-argument-hard-error-in-future'; did you mean '-Werror=unused-command-line-argument'? [-Wunknown-warning-option – Chris Withers Mar 06 '15 at 08:09