1

I need to install Fiona in my Debian7.x-64bits/Python2.7 machine. I already installed GDAL/OGR, pip, virtualenv, and six. I am using Python 2.7 so argparse is also installed. The installation protocol provided at the Fiona website is not completely clear to me:

$ mkdir fiona_env
$ virtualenv fiona_env
$ source fiona_env/bin/activate
(fiona_env)$ pip install Fiona

(Source: https://pypi.python.org/pypi/Fiona )

I followed the steps from both a non-root- and a root-terminal. In the first case some problems related with permissions arose. In the second the errors were related with an inability to find OGR directories.

I am running the installing protocol from my home directory, e.g. me@mymachine:~($ or #). I am not sure if that is the problem. I already checked around for documentation in the Internet, but it seems that the installation protocol from Toblerity (referenced above) is the most explicit.

I would appreciate the community help with the installation of Fiona in my rather standard Debian machine.

2

I'm not on Debian but I can give you the principles.

Look at Fiona. To build from a source distribution you will need a C compiler and the GDAL headers and libraries, so you need to install first GDAL/OGR.

After in the Fiona folder:

  • build the .so files
python setup.py build_ext -I/path/to/gdal/include -L/path/to/gdal/lib -lgdal build
  • build the module:
python setup.py build
  • install the module:
python setup.py install

or in one line:

python setup.py build_ext -I/path/to/gdal/include -L/path/to/gdal/lib -lgdal install

You can also us gdal-config to find the libraries and headers:

gdal_config --libs: gives you The libraries and link directives required to use GDAL
= -L/path/to/gdal/lib
gdal_config --cflags: gives you the include and macro definition required to compiled modules using GDAL. 
= -I/path/to/gdal/include

You can also write the libraries options in the setup.cfg file

  • thanks for your help. The problem I had seemed to be related with the lack of Cython and GDAL/OGR. As I had QGIS running, I assumed GDAL was already installed, but that was not the my case. As I finally managed to install Fiona prior to reading your post, I did not followed your suggestions. But the reference you do to start by checking the C and GDAL prerequisites is quite right. – Jaqo Oct 24 '13 at 7:25
0

For reference: Note that there is a fiona package in debian gis (waiting in the new queue) and on ubuntugis unstable (you can install packages python-fiona and python3-fiona).

For building from source you will need Cython (recent version 0.21) and libgdal-dev. You can actually check the full build dependencies in the package mentioned above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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