Created
January 22, 2015 18:16
-
-
Save sgillies/f7bfff349a676cffb1ef to your computer and use it in GitHub Desktop.
Pip installing Rasterio in a Linux Conda environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rasterio is a C extension, need to apt-get gcc and g++. | |
sudo apt-get update | |
sudo apt-get install curl gcc g++ | |
# Download miniconda. | |
curl "http://mapbox-cloudless-testing.s3.amazonaws.com/landsat8/setup/Miniconda-3.7.0-Linux-x86_64.sh" -o "Miniconda-3.7.0-Linux-x86_64.sh" | |
chmod +x Miniconda-3.7.0-Linux-x86_64.sh | |
./Miniconda-3.7.0-Linux-x86_64.sh -b | |
# Put conda on path. | |
export PATH=/root/miniconda/bin/:$PATH | |
# Make and activate a new conda env. | |
# Get GDAL from the PinguCarsti binstar channel. | |
conda create -n myenv -c PinguCarsti pip gdal gdal-data | |
source activate myenv | |
# VERY IMPORTANT to set this environmental variable! | |
export GDAL_DATA=`gdal-config --datadir` | |
# Build and install rasterio, linking to the stuff from the conda GDAL package. | |
GDAL_CONFIG=`which gdal-config` pip install rasterio | |
# Test. | |
rio transform --src_crs EPSG:4326 --dst_crs EPSG:3857 "[-105,40]" | |
# Expected output: [-11688546.533293728, 4865942.279503176] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment