Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDAL 1.6 & Mac #2

Open
georgiamoon opened this issue Apr 10, 2012 · 11 comments
Open

GDAL 1.6 & Mac #2

georgiamoon opened this issue Apr 10, 2012 · 11 comments

Comments

@georgiamoon
Copy link

I'm using a Mac running 10.6.8. I think that I've found that the "pip install englewood" won't work because it comes with GDAL 1.6, which apparently doesn't work on a Mac.

I'm currently trying to run the scripts having just downloaded the code form github and install GDAL 1.9 and Num.py.

It'd be great to update what GDAL comes with Englewood so that the install works on a Mac!

Thanks.

@JoeGermuska
Copy link

On MacOS 10.6.8, I just made a no-site-packages virtualenv, executed "pip install englewood", and was able to import gdal and do some minor stuff that makes me think that you're running into a different issue.

Are you using virtualenv? if not, the problem may be a collision between GDAL 1.6 and some other libraries you have installed.

Compiling C libraries on Mac can be a headache, so I won't claim to be certain that I can explain further, but in short, it seems to work for me.

@georgiamoon
Copy link
Author

I had the same problem using virtualenv.

What libraries could cause collisions?

@JoeGermuska
Copy link

when you used virtualenv, did you specify "--no-site-packages", or are you using virtualenv 1.7 or newer, where that's the default? If not, you could still be having collision issues.

It's hard to say what could be causing collisions, especially since I'm far from expert in building C libraries and managing their interactions.

If you did use --no-site-packages, I'm at a loss to speculate why what worked for me isn't working for you with the same version of Mac OS.

@georgiamoon
Copy link
Author

I tried that, and I see that when i set that up, I get a message that "--no-site-packages" is the default.

Here is the output when I try "pip install englewood"

Requirement already satisfied (use --upgrade to upgrade): englewood in ./lib/python2.7/site-packages
Downloading/unpacking GDAL==1.6.0 (from englewood)
Running setup.py egg_info for package GDAL

Could not run gdal-config!!!!

Installing collected packages: GDAL
Running setup.py install for GDAL
Could not run gdal-config!!!!
building 'osgeo._gdal' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.6-intel-2.7/extensions/gdal_wrap.o
unable to execute gcc-4.2: No such file or directory
error: command 'gcc-4.2' failed with exit status 1
Complete output from command /Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/bin/python -c "import setuptools;file='/Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/build/GDAL/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /var/folders/p3/fcv_b6c51r17yz6664cby7zw0000gn/T/pip-BFCU1X-record/install-record.txt --install-headers /Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/bin/../include/site/python2.7:
running install

running build

running build_py

running build_ext

Could not run gdal-config!!!!

building 'osgeo._gdal' extension

gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.6-intel-2.7/extensions/gdal_wrap.o

unable to execute gcc-4.2: No such file or directory

error: command 'gcc-4.2' failed with exit status 1


Command /Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/bin/python -c "import setuptools;file='/Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/build/GDAL/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /var/folders/p3/fcv_b6c51r17yz6664cby7zw0000gn/T/pip-BFCU1X-record/install-record.txt --install-headers /Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/bin/../include/site/python2.7 failed with error code 1 in /Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/build/GDAL
Storing complete log in /Users/georgia/.pip/pip.log

@JoeGermuska
Copy link

On Apr 24, 2012, at 3:03 PM, georgiamoon wrote:

unable to execute gcc-4.2: No such file or directory

This is the critical part: the problem isn't specific to GDAL; rather (I'm inferring), GDAL is the first python library you've tried to install which has C bindings, and your system isn't configured to compile C code. This is a common problem for Mac users getting started with python, and once we solve it, we often forget we ever did, so it can take a minute to work out the symptoms.

This has gotten a lot easier, also. See http://kennethreitz.com/xcode-gcc-and-homebrew.html and particularly the section about "Command Line Tools for Xcode"

Give that a shot...

@georgiamoon
Copy link
Author

OK. Uninstalled XCode, used only command line tools, and GCC installer, and this is now the output:

Requirement already satisfied (use --upgrade to upgrade): englewood in ./lib/python2.7/site-packages
Downloading/unpacking GDAL==1.6.0 (from englewood)
Running setup.py egg_info for package GDAL

Could not run gdal-config!!!!

Installing collected packages: GDAL
Running setup.py install for GDAL
Could not run gdal-config!!!!
building 'osgeo.gdal' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.6-intel-2.7/extensions/gdal_wrap.o
extensions/gdal_wrap.cpp:2587:22: error: cpl_port.h: No such file or directory
extensions/gdal_wrap.cpp:2588:24: error: cpl_string.h: No such file or directory
extensions/gdal_wrap.cpp:2590:18: error: gdal.h: No such file or directory
extensions/gdal_wrap.cpp:2591:23: error: gdal_priv.h: No such file or directory
extensions/gdal_wrap.cpp:2592:22: error: gdal_alg.h: No such file or directory
extensions/gdal_wrap.cpp:2593:24: error: gdalwarper.h: No such file or directory
extensions/gdal_wrap.cpp: In function ‘void SWIG_Python_AddErrorMsg(const char
)’:
extensions/gdal_wrap.cpp:870: warning: format not a string literal and no format arguments
extensions/gdal_wrap.cpp: At global scope:
extensions/gdal_wrap.cpp:2610: error: expected initializer before ‘VeryQuietErrorHandler’
extensions/gdal_wrap.cpp:2587:22: error: cpl_port.h: No such file or directory
extensions/gdal_wrap.cpp:2588:24: error: cpl_string.h: No such file or directory
extensions/gdal_wrap.cpp:2590:18: error: gdal.h: No such file or directory
extensions/gdal_wrap.cpp:2591:23: error: gdal_priv.h: No such file or directory
extensions/gdal_wrap.cpp:2592:22: error: gdal_alg.h: No such file or directory
extensions/gdal_wrap.cpp:2593:24: error: gdalwarper.h: No such file or directory
extensions/gdal_wrap.cpp: In function ‘void SWIG_Python_AddErrorMsg(const char_)’:
extensions/gdal_wrap.cpp:870: warning: format not a string literal and no format arguments
extensions/gdal_wrap.cpp: At global scope:
extensions/gdal_wrap.cpp:2610: error: expected initializer before ‘VeryQuietErrorHandler’
lipo: can't figure out the architecture type of: /var/folders/p3/fcv_b6c51r17yz6664cby7zw0000gn/T//ccLkCJz7.out
error: command 'gcc-4.2' failed with exit status 1
Complete output from command /Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/bin/python -c "import setuptools;file='/Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/build/GDAL/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /var/folders/p3/fcv_b6c51r17yz6664cby7zw0000gn/T/pip-Ppgrs9-record/install-record.txt --install-headers /Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/bin/../include/site/python2.7:
running install

running build

running build_py

running build_ext

Could not run gdal-config!!!!

building 'osgeo._gdal' extension

gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.6-intel-2.7/extensions/gdal_wrap.o

extensions/gdal_wrap.cpp:2587:22: error: cpl_port.h: No such file or directory

extensions/gdal_wrap.cpp:2588:24: error: cpl_string.h: No such file or directory

extensions/gdal_wrap.cpp:2590:18: error: gdal.h: No such file or directory

extensions/gdal_wrap.cpp:2591:23: error: gdal_priv.h: No such file or directory

extensions/gdal_wrap.cpp:2592:22: error: gdal_alg.h: No such file or directory

extensions/gdal_wrap.cpp:2593:24: error: gdalwarper.h: No such file or directory

extensions/gdal_wrap.cpp: In function ‘void SWIG_Python_AddErrorMsg(const char*)’:

extensions/gdal_wrap.cpp:870: warning: format not a string literal and no format arguments

extensions/gdal_wrap.cpp: At global scope:

extensions/gdal_wrap.cpp:2610: error: expected initializer before ‘VeryQuietErrorHandler’

extensions/gdal_wrap.cpp:2587:22: error: cpl_port.h: No such file or directory

extensions/gdal_wrap.cpp:2588:24: error: cpl_string.h: No such file or directory

extensions/gdal_wrap.cpp:2590:18: error: gdal.h: No such file or directory

extensions/gdal_wrap.cpp:2591:23: error: gdal_priv.h: No such file or directory

extensions/gdal_wrap.cpp:2592:22: error: gdal_alg.h: No such file or directory

extensions/gdal_wrap.cpp:2593:24: error: gdalwarper.h: No such file or directory

extensions/gdal_wrap.cpp: In function ‘void SWIG_Python_AddErrorMsg(const char*)’:

extensions/gdal_wrap.cpp:870: warning: format not a string literal and no format arguments

extensions/gdal_wrap.cpp: At global scope:

extensions/gdal_wrap.cpp:2610: error: expected initializer before ‘VeryQuietErrorHandler’

lipo: can't figure out the architecture type of: /var/folders/p3/fcv_b6c51r17yz6664cby7zw0000gn/T//ccLkCJz7.out

error: command 'gcc-4.2' failed with exit status 1


Command /Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/bin/python -c "import setuptools;file='/Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/build/GDAL/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /var/folders/p3/fcv_b6c51r17yz6664cby7zw0000gn/T/pip-Ppgrs9-record/install-record.txt --install-headers /Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/bin/../include/site/python2.7 failed with error code 1 in /Users/georgia/Documents/SIDL/Zeega/dotdensity/virtualenv2/build/GDAL
Storing complete log in /Users/georgia/.pip/pip.log

@palewire
Copy link

I just had this issue will trying a pip install inside of a virtualenv in Ubuntu Linux.

$ pip install englewood
Requirement already satisfied (use --upgrade to upgrade): englewood in ./lib/python2.7/site-packages
Downloading/unpacking GDAL==1.6.0 (from englewood)
  Running setup.py egg_info for package GDAL
    
    Could not run gdal-config!!!!
Installing collected packages: GDAL
  Running setup.py install for GDAL
    Could not run gdal-config!!!!
    building 'osgeo._gdal' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/usr/include/python2.7 -I. -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
    extensions/gdal_wrap.cpp:2587:22: fatal error: cpl_port.h: No such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    Complete output from command /home/ben/Code/datadesk/other/foo/bin/python -c "import setuptools;__file__='/home/ben/Code/datadesk/other/foo/build/GDAL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-fn3xDf-record/install-record.txt --install-headers /home/ben/Code/datadesk/other/foo/include/site/python2.7:
    running install
running build
running build_py
running build_ext
Could not run gdal-config!!!!
building 'osgeo._gdal' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/usr/include/python2.7 -I. -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
extensions/gdal_wrap.cpp:2587:22: fatal error: cpl_port.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------

@palewire
Copy link

Having some luck following the GDAL installation here. http://ubuntuforums.org/showthread.php?t=1769445

@chihayakenji
Copy link

I'm having the same issue as @georgiamoon trying to install englewood on OSX Mavericks. I use macports to install all my other ports (including python), so I am sure that it is not related to not having X Tools command line tools installed, as @JoeGermuska wrote. I get precisely the same error and similar output as the one @georgiamoon posted.

@JoeGermuska
Copy link

Yeah, I realize now that I totally misread that error trace.

Hard to advise on C library compilation. I know in the past I've solved compilation problems by setting environment variables in .profile and then later those environment variables turned out to be a problem.

@chihayakenji
Copy link

I managed to run the scripts by cloning the repository, but pip install englewood doesn't work. I have gdal 1.8 installed in my system, and they run ok, but their setup.py file fails. I guess it has something to do with them requiring gdal 1.6 in their setup.py, as their example runs perfectly and the output seems right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants