title: Django on AWS Elastic Beanstalk: Unexpected syncdb error on deploy
body: <p>I have a Django/PostgreSQL application. I use Elastic Beanstalk to deploy it to an Amazon EC2 instance with RDS.</p>
  
  <p>Today, deployment suddenly failed with the following error. Also older code versions are suddenly not able to deploy. </p>
  
  <pre><code>[Instance: i-f8ae27ce Module: AWSEBAutoScalingGroup ConfigSet: null] Command failed on instance. Return code: 1 Output: Error occurred during build: Command 01_syncdb failed .
  </code></pre>
  
  <p>It's related to this command in my elastic beanstalk config file:</p>
  
  <pre><code>command: "django-admin.py syncdb --noinput"
  </code></pre>
  
  <p>Digging in the log files shows that the above command raises this error:</p>
  
  <pre><code>ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
  django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2
  </code></pre>
  
  <p>This is weird, because I have <code>psycopg2</code> in my requirements.txt, and I can verify that it's installed. Also, I have <code>postgresql-devel</code> installed as yum package via the EB config file.</p>
  
  <p>Does anybody know why my deployment suddenly failed?</p>