title: Installing GDAL Python binding in Ubuntu to use as standalone module
body: <p>I am trying to export a GeoTiff with Blender using the Blender Python API (based on Python 3), so I've decided to install GDAL on Ubuntu (14.04). What I would like is to get the module as a standalone folder that I could put in the modules directory of Blender (/home/user/.config/blender/2.73/scripts/modules).</p>
  
  <p>The thing is I've run through several different problems trying to install GDAL. I've tried to install from source (for GDAL 2.0.0) here : <a href="https://pypi.python.org/pypi/GDAL/" rel="nofollow">Official PyPi Gdal</a></p>
  
  <ul>
  <li>I ran <code>sudo apt-get install libgdal-dev gdal-bin</code> (I list it here because it may be important)</li>
  <li>When I am in the extracted GDAL folder, using <code>python setup.py build &amp; python setup.py install</code>, the library installs to <code>/usr/local/lib/python2.7/dist-packages/osgeo</code>. However, when I run <code>python</code> from command line, running <code>from osgeo import osr</code> returns <code>ImportError: No module named _gdal</code></li>
  <li>Following <a href="http://www.iup.uni-bremen.de/~hilboll/blog/2013/2013-10_installing-gdal-in-a-virtualenv.html" rel="nofollow">GDAL via pip</a> , I used pip (<code>pip install GDAL</code>) to install the library, and the folder it went to was <code>/usr/lib/python3/dist-packages/osgeo</code> (using <code>pip show ...</code>). Again, running <code>python3</code> and trying to import results in the same error. Of course, when I copy-paste each folder in the blender module directory, I get the same error in the Blender Python console. </li>
  <li>So I decided to compile the sources using <code>./configure --with-python &amp; make &amp; make install</code> in the source folder. I then copied the folder <code>GDAL-x.x.x/build/lib.linux-x86_64-3.4/osgeo</code> to the blender modules directory and got this time the error when importing : <code>ImportError: /home/yvesu/.config/blender/2.73/scripts/modules/osgeo/_gdal.so: undefined symbol: _Py_ZeroStruct</code>.</li>
  <li>Trying to compile with python3 using <code>python3 setup.py build</code> returns the error <code>error: command 'x86_64-linux-gnu-gcc' failed with exit status 1</code> </li>
  </ul>
  
  <p><strong>EDIT 1</strong>: 
  I think I've found the solution : I went to the directory <code>swig/python</code> (not found in a GDAL-1.11.0 folder but gdal-1.11.0 fodler, can't remember where I downloaded it from), ran <code>python3 setup.py build &amp; python3 setup.py install</code> and could finally find the folder in <code>/usr/local/lib/python3.4/dist-packages/GDAL-1.11.0-py3.4-linux-x86_64.egg/osgeo</code>. When I put this osgeo folder oni the Blender modules directory, I was able to import osgeo in Blender. I will report if anything went wrong.</p>
  
  <p>I think I've listed all my attempts at installing GDAL on Ubuntu. Can anyone point me in the right direction? Do you think it is even possible to install it as a standalone module, or do I need linked libraries through LD_LIBRARY_PATH? </p>