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

ImportError: cannot import name migrations #9

Open
Jorigorn opened this issue Nov 5, 2014 · 1 comment
Open

ImportError: cannot import name migrations #9

Jorigorn opened this issue Nov 5, 2014 · 1 comment

Comments

@Jorigorn
Copy link

Jorigorn commented Nov 5, 2014

(django_blog)[root@localhost django_blog]# python manage.py syncdb
Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

Synced:

django.contrib.admin
django.contrib.auth
django.contrib.contenttypes
django.contrib.sessions
django.contrib.messages
django.contrib.staticfiles
django.contrib.sitemaps
pagedown
south
compressor
debug_toolbar

Not synced (use migrations):

  • reversion
  • apps.blog
    (use ./manage.py migrate to migrate these)

(django_blog)[root@localhost django_blog]# python manage.py migrate apps.blog
Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/django/core/management/init.py", line 399, in execute_from_command_line
utility.execute()
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/django/core/management/init.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(_args, *_options.dict)
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(_args, *_options)
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
ignore_ghosts = ignore_ghosts,
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/south/migration/init.py", line 173, in migrate_app
Migrations.calculate_dependencies()
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/south/migration/base.py", line 229, in calculate_dependencies
migration.calculate_dependencies()
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/south/migration/base.py", line 363, in calculate_dependencies
for migration in self._get_dependency_objects("depends_on"):
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/south/migration/base.py", line 343, in _get_dependency_objects
for app, name in getattr(self.migration_class(), attrname, []):
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/south/migration/base.py", line 315, in migration_class
return self.migration().Migration
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/south/utils/init.py", line 62, in method
value = function(self)
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/south/migration/base.py", line 304, in migration
raise exceptions.UnknownMigration(self, sys.exc_info())
south.exceptions.UnknownMigration: Migration 'reversion:0001_initial' probably doesn't exist.
Traceback (most recent call last):
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/south/migration/base.py", line 302, in migration
migration = import(full_name, {}, {}, ['Migration'])
File "/root/.virtualenvs/django_blog/lib/python2.7/site-packages/reversion/migrations/0001_initial.py", line 4, in
from django.db import models, migrations
ImportError: cannot import name migrations

@laoyang103
Copy link

Run 'pip list' and check django version is 1.7.4
The follow is my 'pip list' output:
Django (1.7.4)
django-appconf (1.0.1)
django-compressor (1.5)
django-debug-toolbar (1.2.2)
django-pagedown (0.1.0)
django-reversion (1.8.7)
ecdsa (0.13)
Fabric (1.10.1)
Markdown (2.6.2)
paramiko (1.15.2)
pip (7.0.3)
pycrypto (2.6.1)
Pygments (2.0.2)
setuptools (17.0)
six (1.9.0)
sqlparse (0.1.15)
wheel (0.24.0)

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

2 participants