If you are planning to participate in the "Geospatial data in Python: Database, desktop, and the web" tutorial associated with this Github repository, the following are the suggested installation instructions. We will take time during the session to go over installation issues, but if possible, at least try to have some of these installation steps completed before we start. If you are unsure of how/where to start, no problem, just show up to the session (or better yet, the 'install party' beforehand) and we'll get you going!
-
First, check the Known Issues below for OS-specific Initial Setups.
-
Install
Anaconda
(I'm using Anaconda-2.1.0 [64-Bit - Python 2.7])- We're using
Anaconda
because it helps us to keep ourPython
environment clean and manageable. If you prefer, you can also useCanopy
or an alternativePython
distribution.
- We're using
-
Create a new virtual environment (Skip this step on Windows, trust me, it'll be easier):
```bash conda create -n pygeo pandas ipython-notebook matplotlib source activate pygeo ```
-
Install
pip
for later (pip
allows us to install additionalPython
packages not available viaconda
:bash conda install pip
-
If you don't already have it, you might need to install
cython
```bash conda install cython ```
-
Install required packages (on Windows, you might need to install binaries from here for
shapely
,pyproj
, andrasterio
).```bash pip install shapely pip install fiona pip install PIL pip install pyproj pip install descartes pip install rasterio ```
-
You can use
pillow
in place ofPIL
if you like. -
If any of the above commands cause an error, you can try using
conda
instead (replacePACKAGE
below with the package you are trying to install):conda install PACKAGE
-
or check to see if a
conda
package exists usingbinstar
:conda install binstar binstar search -t conda PACKAGE
-
Make sure you find one for your OS. You can get more info about a package using the following command, which will also explain how to install the package:
binstar show <USER/PACKAGE>
-
For example, you could used the following to install
pyproj
on OS X:conda install --channel https://conda.binstar.org/asmeurer pyproj
-
-
-
Install
geopandas
(important!)```bash pip install geopandas ```
-
Install
cartopy
(on Windows, use binaries from here forcartopy
.)pip install pyshp pip install cartopy
-
Install
mplleaflet
(for making slippy maps). See theKnown Issues
below about installgit
.pip install git+git://github.com/mpld3/mplexporter.git pip install git+git://github.com/jwass/mplleaflet.git
-
Install
geojson.py
for shooting data to the web!pip install git+git://github.com/jwass/geojsonio.py.git
-
Install
basemap
, a common package for making static maps (I didn't install this):conda install basemap
-
Install
psycopg2
for interacting with PostGIS (We don't need this, but I will do a demo with this):pip install psycopg2
- Go to the official QGIS page for details, or install via
brew
on OSX,apt-get
on Linux, orOSGeo4W
on Windows (Either way, this install will likely take quite a while).-
I installed this on OSX via
homebrew
with:brew tap osgeo/osgeo4mac brew install qgis-26
-
On Linux, if you follow the
Linux Initial Setup
below first, you should be able to install QGIS with:sudo apt-get install qgis
-
On Windows, follow the instructions on the official QGIS page.
-
- Here is the install guide from a similar course last year.
- In some cases, it may be better to
pip install shapely
than toconda install shapely
, particularly when usingcartopy
. - If
cartopy
andshapely
don't place nice together, it may be because of version issues. Please take a look here for a possible fix: #3
-
Initial Setup
sudo apt-get install git sudo add-apt-repository -y ppa:ubuntugis/ppa sudo apt-get update sudo apt-get install -y gdal-bin libgdal-dev
-
On newer versions of Ubuntu (14.04 +), you may want to use the unstable repo (which is actually quite stable):
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
-
On vanilla Ubuntu, you might need to install
g++
before installingrasterio
and others:sudo apt-get install g++
-
-
Initial Setup
-
First install
brew
:ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
-
Then update and install
gdal
(You might be able to skip this step if youconda install fiona
[see above]).brew doctor brew update brew install git brew tap osgeo/osgeo4mac brew install gdal brew install qgis
-
-
On Mavericks+ if you don't already have developer tools installed,
pip install pyproj
will probably fail (due to missinggcc
) and then ask you if you want to install them, so click 'yes' and then rerunpip install pyproj
. -
In some cases, importing
shapely
on OS X might fail while loading the GEOS library:bash OSError: Could not find library c or load any of its variants.
-
This can be fixed by using a newer version, or worked around by setting the following environment variable (add to your
.bash_profile
; see this issue for details):export DYLD_FALLBACK_LIBRARY_PATH=$(HOME)/lib:/usr/local/lib:/lib:/usr/lib
-
-
Initial Setup
-
If you don't already have it, you'll need to install
git
: -
On Windows,
source
is not needed when activating a virtual environment if you are using the Anaconda Command Prompt:activate scipygis
.