Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to setup an isolated python virtualenv to work on GIS projects on my Mac OS X. Sounds like I will need to install the GEOS, PROJ, GDAL/OGR from the kyngchaos site here http://www.kyngchaos.com/software/frameworks and not easy_install it into my virtualenv. Is that accurate?

The downloads available on kyngchaos are pkg installers and not just an egg or bdist of python modules. So, I am not very sure as to what else the installer is doing to the environment other than just copying files to /Library/Framework/geos.framework folder.

How would I go about installing a specific version of GEOS, PROJ, GDAL/OGR into my new python virtualenv? I would appreciate your help/suggestions on this issue.

Thank You, Vish

share|improve this question
add comment

4 Answers 4

up vote 3 down vote accepted

If each Framework of Kyngchaos is in the PATH, it is easy. Every framework has a Unix folder, with the libraries for compiling things like pyproj or geos python wherever you want, even in a private Python environment (I've never had a problem)

The only problem is that Gdal python is in the Gdal Framework. But in site-packages there a file gdal.pth

gdal.pth file:

import sys; sys.path.insert(0,'/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages')

if you do not want to compile it yourself, copy this file in your isolated python virtualenv

share|improve this answer
    
having installed those projects by hand, through 3rd party installers (fink/macports/whatever) and through other means I will guarantee to you that the best way is through Kynchaos! +1000 –  Ragi Yaser Burhum Feb 24 '12 at 1:39
add comment

If you need to use OSX you can easily avoid installation complexities by installing homebrew!

After this the only commands you will need to enter are:

brew install gdal

It will automatically install also proj and geos because they are gdal dependencies.

share|improve this answer
add comment

I make replicable Python/C/C++ GIS environments using virtualenv and zc.buildout. My ichpage https://github.com/sgillies/ichpage project is a little dated but could serve as a template for an up-to-date one (like the one I use for my Pleiades site development work and deployments). Blog post about it at http://sgillies.net/blog/856/i-can-has-python-and-gis-environments/.

share|improve this answer
add comment

Virtualenv allows you to provision a private Python environment, but does not extend to system libraries outside of the Python universe. The three packages you mentioned are all C/C++ applications at their core, so while they have interfaces for use with Python, they cannot be packaged without interacting with the C libraries (libc on up).

Because of the difficulty installing those packages from scratch, particularly on OS X, you may want to think about running a sandboxed virtual machine using something like VirtualBox and install the packages through apt on that sandboxed machine: while it is possible to do the same on OS X, it probably isn't worth the effort.

share|improve this answer
    
This is a good recommendation. I followed this approach using Fusion, not VirtualBox, but I might try Virtual Box next time. I used CentOS for the OS in the box. (Not the best OS choice due to the stable nature and older versions of Python, etc.) –  DavidF Feb 22 '11 at 16:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.