Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDAL python bindings not liking virtualenv #137

Open
evz opened this issue Oct 21, 2011 · 1 comment
Open

GDAL python bindings not liking virtualenv #137

evz opened this issue Oct 21, 2011 · 1 comment

Comments

@evz
Copy link
Contributor

evz commented Oct 21, 2011

Yesterday when I was trying to set up the project on a Ubuntu VM (11.04 and later I tried 10.04), I kept running into the same issue when installing the requirements via pip. Basically, it seemed that, even though I had all the GIS libraries as well as PostgreSQL installed globally (using apt-get) the GDAL python bindings did not want to compile in the virtualenv. They complained about missing header files which I'm assuming were someplace in the VM since I had libgdal-dev installed and since I could install those bindings globally without a hitch.

I realize this is one of those things that this project doesn't have much control over but I thought I'd bring it up anyways just in case someone out there had recommendations as to how I should proceed.

@evz
Copy link
Contributor Author

evz commented Oct 21, 2011

For whatever it's worth, here's what I did to get the rig running by installing everything globally within my VM:

apt-get install git-core
apt-get install python-software-properties
add-apt-repository ppa:pitti/postgresql # PPA for PostgreSQL 9.0
add-apt-repository ppa:ubuntugis/ubuntugis-unstable # PPA for current GIS libs
apt-get update
apt-get install libgdal1-dev libgeos-dev proj python-dev libpq-dev postgresql-server-dev-9.0 postgresql-contrib-9.0 python-gdal mongodb mdbtools
apt-get install git-core
git clone https://github.com/ireapps/census.git
cd census/censusweb/
vi requirements.txt # Comment out GDAL line
pip install -r requirements.txt 
wget http://postgis.refractions.net/download/postgis-1.5.3.tar.gz 
tar -xvf postgis-1.5.3.tar.gz
cd postgis-1.5.3/
./configure
make
make install
su - postgres # Switch to postgres superuser
psql
### Inside pgsql shell
postgres=# create user censusweb with password 'Xy9XKembdu'; # Create new user to match the one in settings.py
postgres=# \q
### Back to bash 
psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';"
psql -d template_postgis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/postgis.sql
psql -d template_postgis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/spatial_ref_sys.sql
psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;"
psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;"
psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;"
exit # Switch back to root
python manage.py runserver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant