Import error cannot import name execute_manager in windows environment Import error cannot import name execute_manager in windows environment django django

Import error cannot import name execute_manager in windows environment


execute_manager deprecated in Django 1.4 as part of the project layout refactor and was removed in 1.6 per the deprecation timeline: https://docs.djangoproject.com/en/1.4/internals/deprecation/#id3

To fix this error you should either install a compatible version of Django for the project or update the manage.py to new style which does not use execute_manager: https://docs.djangoproject.com/en/stable/releases/1.4/#updated-default-project-layout-and-manage-py Most likely if your manage.py is not compatible with 1.6 then neither is the rest of the project. You should find the appropriate Django version for the project.


@Mark Lavin explained nicely what the error means and how it arises. I think I've just discovered why others may also get this error message so leaving it here for the record.

I'm assuming you're running this from within a virtual environment.

When starting a new Django project, if you run django-admin startproject <myproject>, you are invoking the global installation of Django. If, as in my case, it comes from a stale repo, it may be an old version - in my case:

>> django-admin --version>> 1.3.1

If you want to run Django from within a virtual environment, then you need to invoke it with django-admin.py startproject <myproject>. This way, you get a Django project with the version corresponding to your local installation:

>> django-admin.py --version>> 1.6.6


I was getting this error because I had an old version of django-admin.py in my /usr/local/bin folder and I had forgotten to create a new virtualenv for my new project.

Remember that the steps for a new project should be:

  1. First create a new virtualenv for your new project:
    mkvirtualenv <mynewproj>
  2. Update the Python version for your virtualenv if necessary:
    virtualenv --python $(which python3.6) ~/.virtualenvs/<mynewproj>
  3. Then create your Django project folder structure:
    django-admin startproject <django project name>

I also deleted my old obsolete /usr/local/bin/django-admin.py because it was created before I discovered the joys of virtualenv.