I'm trying to install GDAL 1.7.1 on Mac OS X Lion using:
python setup.py build
python setup.py install
and get the error:
running build
running build_py
running build_ext
building 'osgeo._gdal' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch i386 -arch x86_64 -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-x86_64.egg/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/1.7/include -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.7-intel-2.7/extensions/gdal_wrap.o
unable to execute llvm-gcc-4.2: No such file or directory
error: command 'llvm-gcc-4.2' failed with exit status 1
Is this the right compiler? How can I get this working?
UPDATE:
I get a little further with Xcode installed:
running build
running build_py
running build_ext
building 'osgeo._gdal' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-x86_64.egg/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/1.7/include -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.7-intel-2.7/extensions/gdal_wrap.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
extensions/gdal_wrap.cpp:2813:22: error: cpl_port.h: No such file or directory
extensions/gdal_wrap.cpp:2814:24: error: cpl_string.h: No such file or directory
extensions/gdal_wrap.cpp:2815:27: error: cpl_multiproc.h: No such file or directory
extensions/gdal_wrap.cpp:2817:18: error: gdal.h: No such file or directory
extensions/gdal_wrap.cpp:2818:23: error: gdal_priv.h: No such file or directory
extensions/gdal_wrap.cpp:2819:22: error: gdal_alg.h: No such file or directory
extensions/gdal_wrap.cpp:2820:24: error: gdalwarper.h: No such file or directory
extensions/gdal_wrap.cpp:2837: error: expected initializer before ‘VeryQuietErrorHandler’
extensions/gdal_wrap.cpp:2713: warning: ‘swig_module’ defined but not used
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
extensions/gdal_wrap.cpp:2813:22: error: cpl_port.h: No such file or directory
extensions/gdal_wrap.cpp:2814:24: error: cpl_string.h: No such file or directory
extensions/gdal_wrap.cpp:2815:27: error: cpl_multiproc.h: No such file or directory
extensions/gdal_wrap.cpp:2817:18: error: gdal.h: No such file or directory
extensions/gdal_wrap.cpp:2818:23: error: gdal_priv.h: No such file or directory
extensions/gdal_wrap.cpp:2819:22: error: gdal_alg.h: No such file or directory
extensions/gdal_wrap.cpp:2820:24: error: gdalwarper.h: No such file or directory
extensions/gdal_wrap.cpp:2837: error: expected initializer before ‘VeryQuietErrorHandler’
extensions/gdal_wrap.cpp:2713: warning: ‘swig_module’ defined but not used
lipo: can't open input file: /var/tmp//ccgnLEPX.out (No such file or directory)
error: command 'llvm-gcc-4.2' failed with exit status 1
Homebrew works great for me. To install GDAL 1.9 with Homebrew all you have to do is
brew install gdal
Homebrew requires xcode, and I think commandline tools. More information can be found here
How about using the precompiled binaries available from http://www.kyngchaos.com/software/frameworks
Also, are you using 1.7.1 for a specific reason? 1.8.1 is, I believe, the current release build.
Caveat: I do not know if Lion is yet supported by the GDAL OSX binaries.
Did you actually install Xcode 4.1 on 10.7? Downloading it from the App Store is not enough; you have to manually run the Installer which it downloads to /Applications.
If you actually want to build from source, but want a convenient way to install there is a gdal package available from MacPorts - just install MacPorts, then on the command line type:
port install gdal
Macports will fetch and compile the source code for you. As of the time of writing the version in MacPorts is 1.9.0
for installing GDAL on mac:
brew install gdal
and then
pip install gdal
solved this for me
Related
On Mac I want to install mysql-python for django.
run
sudo pip install MySQL-python
show me
File "<string>", line 17, in <module>
File "/private/tmp/pip_build_root/MySQL-python/setup.py", line 17, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
So I downloaded MySQL-python-1.2.5
run
sudo python setup.py build
I get error:
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
running build_ext
building '_mysql' extension
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql-5.5.19-osx10.6-x86_64/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-common -fno-strict-aliasing -arch x86_64
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
Then I try to fix this like this page
Can't install python mysql library on Mac Mavericks
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
not useful for me...
It still show me command 'cc' failed with exit status 1
What should I do??????? so so so sad~~~~~~~ almost a day~~~~~~~
The issue is that the installation didn't find mysql_config. You'll have to add the path to mysql_config in the site.cfg file of the installation directory.
# file : site.cfg
mysql_config = /path/to/mysql_config
I found the problem. Once I install the simulator for xcode, I can install with
sudo -E python setup.py install
no problem any more.
I'm having major issues this morning trying to install mysql-python connector on the Mac.
The issues is down to a recent update to xcode 5.1:
http://bruteforce.gr/installing-mitmproxy-os-x-maverics-bypassing-clang-error-unknown-argument.html
http://forums.getpebble.com/discussion/11862/installation-error-perhaps-due-to-xcode-5-1
However, I have tried the current work-around and I still get the error:
This is what I have tried:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future sudo pip install mysql-python
This is the error:
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
Anyone had the same issue and know of a workaround that works in your virtual env?
I wrote the post on your first link. I am not 100% percent sure but I think the problem lies with the use of sudo. The variable is set under your user, while the pip command is elevated to root privileges, i.e. is executed under another user. Try to do the above logged in as root user from the start, without sudoing.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
The problem with installing PIL using virtualenv or buildout
how to install PIL on mac os x 10.7.2 Lion
I'm trying to install the latest version of PIL (1.1.7) on Mac OS X Lion (10.7.4). I generally just use PIP and the following command:
sudo pip install package_name
However, I'm getting an error message for PIL, as it is refusing to cooperate with me.
Here is what I received:
mac-cordreys-macbook-pro:~ maccordrey$ sudo pip install PIL
Password:
Downloading/unpacking PIL
Downloading PIL-1.1.7.tar.gz (506Kb): 506Kb downloaded
Running setup.py egg_info for package PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
Installing collected packages: PIL
Running setup.py install for PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.7-intel-2.7/_imaging.o
unable to execute llvm-gcc-4.2: No such file or directory
error: command 'llvm-gcc-4.2' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;__file__='/Users/maccordrey/build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-KmYgGQ-record/install-record.txt:
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-intel-2.7
copying PIL/__init__.py -> build/lib.macosx-10.7-intel-2.7
(To save space I've redacted this middle portion, but it's just more copying of package scripts.)
copying PIL/XVThumbImagePlugin.py -> build/lib.macosx-10.7-intel-2.7
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
creating build/temp.macosx-10.7-intel-2.7
creating build/temp.macosx-10.7-intel-2.7/libImaging
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.7-intel-2.7/_imaging.o
unable to execute llvm-gcc-4.2: No such file or directory
error: command 'llvm-gcc-4.2' failed with exit status 1
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/Users/maccordrey/build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-KmYgGQ-record/install-record.txt failed with error code 1 in /Users/maccordrey/build/PIL
Storing complete log in /Users/maccordrey/Library/Logs/pip.log
Any advice would be appreciated! Thank you!
I should also note that when trying to install Pillow as an alternative I received the exact same error message.
I want use Twisted in Python, but when I installing ,in comes this error, how to handle it?
....
running build_ext
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c conftest.c -o conftest.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c conftest.c -o conftest.o
building 'twisted.runner.portmap' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c twisted/runner/portmap.c -o build/temp.linux-i686-2.7/twisted/runner/portmap.o
twisted/runner/portmap.c:10:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
You are missing the python development headers, needed to build packages that need to compile extensions.
If you are building on OSX, make sure you either install a prebuilt mac python package or if building python from source, use the framework flag when configuring. And also make sure you have XCODE installed so that you have a compiler.
If you are building on Linux, you probably need to install the python devel headers. For instance on Ubuntu you would need: apt-get install build-essential python-dev.
Once you have the python development headers, twisted should be able to find them when you build with that python interpreter.
I am trying to install PIL using PIP installer, and I'm getting this:
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.7-intel-2.7/_imaging.o
unable to execute llvm-gcc-4.2: No such file or directory
error: command 'llvm-gcc-4.2' failed with exit status 1
Any clues what the problem might be ?
I have Mac OS X Lion and LLVM is installed in the XCODE Developer tools... What can be wrong ?
i got the same error.
but additionally need to install the "commandline tools" under settings
edit:
just a few keywords for google, if someone is looking for this!
easy_install pip gcc not found mac osx xcode
may be a moderator add this keywords to the question
Are you sure you have actually run the Xcode installer (usually found in /Applications)? Downloading it from the Mac App Store doesn't automatically run the installer.
Check that you have installed XCode. Try installing a PIL from homebrew package manager