title: Flask - ImportError: No module named migrate.versioning
body: <p>I'm working through a flask tutorial and am trying to run a script that creates a database instead of doing it through the command line. It uses the SQLAlchemy-migrate package, but when I try to run the script, it gives an ImportError.</p>
  
  <p>This is the terminal output: </p>
  
  <pre><code>Sean:app seanpatterson$ python ./db_create.py 
  Traceback (most recent call last):
    File "./db_create.py", line 2, in &lt;module&gt;
      from migrate.versioning import api
  ImportError: No module named migrate.versioning
  </code></pre>
  
  <p>This is the db_create.py script:</p>
  
  <pre><code>#!flask/bin/python
  from migrate.versioning import api
  from config import SQLALCHEMY_DATABASE_URI
  from config import SQLALCHEMY_MIGRATE_REPO
  from app import db
  import os.path
  db.create_all()
  if not os.path.exists(SQLALCHEMY_MIGRATE_REPO):
      api.create(SQLALCHEMY_MIGRATE_REPO, 'database repository')
      api.version_control(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
  else:
      api.version_control(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO,     api.version(SQLALCHEMY_MIGRATE_REPO))
  </code></pre>
  
  <p>This is the config file it references:</p>
  
  <pre><code>#!/usr/bin/env python
  import os
  basedir = os.path.abspath(os.path.dirname(__file__))
  
  SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
  SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
  </code></pre>
  
  <p>This application is being run with a virtual environment. This are the module that relates to it that I have installed in the environment:</p>
  
  <p>sqlalchemy_migrate-0.7.2-py2.7.egg-info</p>
  
  <p>Any help appreciated</p>