1

I am trying to create an app using GeoDjango and I am completely new to this. After some (failing) attempts at making SpatiaLite work, I decided to try out PostgreSQL. I am following the GeoDjango tutorial, and I am stuck at the python manage.py sqlall world line. When I ran that command (or python manage.py syncdb), I got ImportError: No module named psycopg2.extensions. I looked online and realized I needed to install psycopg2, which I did via MacPorts with sudo port install py27-psycopg2. I reran the program and got the same error. I restarted my computer and ran the program again, and still got the same error. Does anyone know anything else that might have caused this?

Thanks!

PS. If anyone cared to know, I was stuck at the same command while testing out SpatiaLite. I consistently received the 'DatabaseOperations' object has no attribute 'geo_db_type'error. I looked around the internet, didn't find any answer and decided to move on for the time being and maybe try again later.

PSS. I am working on Mac OS X 10.7.5

Chris Travers
  • 25,424
  • 6
  • 65
  • 182
essicajayc
  • 33
  • 1
  • 6
  • 2
    Apple systems often land up with many different installs of common tools like Python. At a guess I'd say the Python being used by Django is not the one from Homebrew that you installed psycopg2 for. – Craig Ringer Aug 08 '13 at 07:36
  • In that case, would installing python through easy_install fix the problem? Would this mess up my other tools that use the default python with my system? I have encountered so many dependency issues lately... – essicajayc Aug 08 '13 at 22:40
  • I couldn't really say, I don't use Mac OS X much these days and you'd need to provide more info for me to be able to answer anyway. You need to (a) identify which Python is being used by Django then (b) install psycopg2 into that Python. That'll depend a lot on how you installed Django: as a bundled installer, via a port system like macports or homebrew, manually from source, etc. – Craig Ringer Aug 09 '13 at 01:14

0 Answers0