Error installing PyObjc: command '/usr/bin/clang' failed - python

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?

Terminal post:
xcode-select --install
may be can help you.

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

Related

Linux : unable to install kivy in virtual environment

I am using python2.7 and created a virtual environment 'kivyenv'.
First i install Cython and then kivy in kivyenv.
pip install Cython
pip install kivy
kivy failed to install giving some error :-
In file included from /tmp/pip-build-4T9oG4/kivy/kivy/graphics/opengl.c:274:0:
/tmp/pip-build-4T9oG4/kivy/kivy/graphics/gl_redirect.h:43:22: fatal error: GL/gl.h: No such file or directory
# include <GL/gl.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/root/kivyenv/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4T9oG4/kivy/setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))"
install --record /tmp/pip-3__DxE-record/install-record.txt --single-version-externally-managed --compile --install-headers
/root/kivyenv/include/site/python2.7/kivy" failed with error code 1 in /tmp/pip-build-4T9oG4/kivy/
I am using Ubuntu 16.
This is happening because you do not have dependency libraries installed on your system, specifically the ones for OpenGL - most likely you do not have mesa packages installed.
Follow the instructions for your specific distribution on how to install all of the needed dependencies at: https://kivy.org/docs/installation/installation-linux.html#using-software-packages
had the same problem. the following worked for me:
pip(3) install Cython==0.26
pip(3) install kivy
hope it helps

Error while installing scrapy on mac OSX 10.11.1

I am new to scrapy and i tried installing scrapy on mac using this command
sudo pip install scrapy
and i got this error:
Command "/usr/local/opt/python/bin/python2.7 -c "import setuptools,
tokenize;file='/private/tmp/pip-build-lpJzV8/lxml/setup.py';exec(compile(getattr(tokenize,
'open', open)(file).read().replace('\r\n', '\n'), file,
'exec'))" install --record /tmp/pip-H3llSf-record/install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-lpJzV8/lxml
Can someone help?
Dont know if you have command line tools installed as #birryree suggested. If not, you could fire up the terminal (type terminal in spotlight) and type xcode-select --install. Then run pip again. By the way, I tried installing just now and it installs fine.

Cannot import python-goose (OSX 10.9)

I am trying to properly set up python-goose in a virtualenv.
Update: I nuked python and started with a clean install as outlined here.
I followed the python-goose instructions and did:
mkvirtualenv --no-site-packages goose
git clone https://github.com/grangier/python-goose.git
cd python-goose
pip install -r requirements.txt
python setup.py install
pip install -r requirements.txt fails on lxml
Error I get now is:
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /Users/me/.virtualenvs/goose/bin/python -c "import setuptools, tokenize;__file__='/Users/me/.virtualenvs/goose/build/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/wg/82j6ndq50tl4m9rjkqszyx8r0000gp/T/pip-c9DtYT-record/install-record.txt --single-version-externally-managed --compile --install-headers
/Users/me/.virtualenvs/goose/include/site/python2.7 failed with error code 1 in
/Users/me/.virtualenvs/goose/build/lxml
Is there anything I am doing incorrectly or are there any alternative ways I can try to get this working?
Finally found a solution:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
Seems like this error is caused by the latest clang update from Apple that came with Xcode 5.1
"Update: Did not expect this to get so much attention, but here's more
detail: the clang 3.4 Apple is shipping defaults to erroring on
unknown flags, but CPython builds modules using the same set of flags
it was compiled with originally. The system CPython was compiled with
several flags that are unknown by clang, thus causing this problem."
Read more here: https://stackoverflow.com/a/22315129/2673189
Again, thanks to Wolph and pseudocubic, you were very helpful.

Installing matplotlib on OS X 10.9.1

I have installed Homebrew, Xcode and all the necessary tools but when I executed this command on the terminal: brew install matplotlib
The following error occurred after installation
1 warning and 1 error generated.
error: command 'clang' failed with exit status 1
Cleaning up...
Command /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools, tokenize;file='/private/var/folders/g7/nt2vgm9x0wv_r0pz6sm_18y00000gn/T/pip_build_Joshua/matplotlib/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/g7/nt2vgm9x0wv_r0pz6sm_18y00000gn/T/pip-OxzEFW-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/g7/nt2vgm9x0wv_r0pz6sm_18y00000gn/T/pip_build_Joshua/matplotlib
Storing debug log for failure in /Users/Joshua/.pip/pip.log
Does anyone know how to fix this problem? The matplotlib does not work on my python script file.
1) Do you have any errors if you run brew doctor?
2) If you have a brewed Python installed, you should be using the brewed pip to install matplotlib. ie. pip install matplotlib

Can't install discount with pip: error: command 'cc' failed with exit status 1

I am running into many problems when trying to install the discount package on osx 10.9 Mavericks. I'm working with the django framework.
My steps are (while having a virtualenv activated):
pip install discount
Then I get:
.
.
.
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /Users/KaeserMic/Sites/2013/Duotones/naturkostbar/env/bin/python -c "import setuptools;__file__='/Users/KaeserMic/Sites/2013/Duotones/naturkostbar/env/build/discount/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/4b/smwv2y_s32z044brp6t__ssh0000gp/T/pip-65i7x3-record/install-record.txt --single-version-externally-managed --install-headers /Users/KaeserMic/Sites/2013/Duotones/naturkostbar/env/include/site/python2.7 failed with error code 1 in /Users/KaeserMic/Sites/2013/Duotones/naturkostbar/env/build/discount
Storing complete log in /Users/KaeserMic/.pip/pip.log
Here is the complete log:
https://gist.github.com/MichaelKaeser/7302829
Things I did:
updating python
updating pip
updating virtualenv
updating homebrew
Any ideas how to solve this issue?
Thanks in advance.
Try:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install discount
This seems to be an issue with LLVM in XCode 5.1 as mentioned here: Can't install mysql gem on OS X
If you enter gcc or cc in the terminal, will it output an error? Do you have Xcode installed?
xcode-select....
If so, Mac Os Mavericks should alert you to install Xcode Command Line Tools.

Categories