Satchmo clonesatchmo.py ImportError: cannot import name execute_manager
Asked Answered
C

2

11

I get satchmo to try, but I have a great problem at first try, and I don't understand whats wrong. When I making $ python clonesatchmo.py into clear django project, it trows an error:

$ python clonesatchmo.py
Creating the Satchmo Application
Customizing the files
Performing initial data synching
Traceback (most recent call last):
  File "manage.py", line 18, in <module>
    from django.core.management import execute_manager
ImportError: cannot import name execute_manager
Traceback (most recent call last):
File "manage.py", line 18, in <module>
  from django.core.management import execute_manager
ImportError: cannot import name execute_manager
Error: Can not copy the static files.
Error: Can not syncdb.

AND creates a store folder. trying smth like this is working!!:

$ python manage.py shell
>>> import os, sys
>>> print sys.executable
/some/path/to/python
>>> os.system('bash')
$ /some/path/to/python manage.py validate
# this is NOT fail on "from django.core.management import execute_manager"

I have Django 1.6 and Satchmo 0.9.3, python 2.7.5 (I do not use virtualenv)

Conserve answered 4/8, 2013 at 22:26 Comment(2)
"(I do not use virtualenv)" orly? /some/path/to/python sure looks like one.Woodhouse
@Woodhouse But it is standart path... it was advise in google groups to make this action.. the "/some/path/to/python" is: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/PythonConserve
S
11

execute_manager was put on the deprecation path as part of the project layout refactor in Django 1.4 https://docs.djangoproject.com/en/1.4/releases/1.4/#django-core-management-execute-manager. Per the deprecation policy that means that the code for execute_manager has been completely removed in 1.6. If you are seeing this import error then the version of Satchmo you are using has not been updated to be compatible with Django 1.6.

Silvasilvain answered 5/8, 2013 at 0:17 Comment(2)
Thanks a lot!! But how can i locate where to replace it? I replace all imports in 'manage.py's but it seems i miss smth...Conserve
Even if you fix this import, I don't think you will be able to get this working. Satchmo doesn't claim to support Django 1.5 much less 1.6 which is currently in beta.Silvasilvain
N
66

Replace the contents of manage.py with the following (from a new django 1.6 project).

#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "<app>.settings")

    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)
Nimble answered 15/11, 2013 at 3:55 Comment(1)
this helped me in figuring how how ot use google's examples for using their api from django code.google.com/p/google-api-python-client/source/browse/…Bangka
S
11

execute_manager was put on the deprecation path as part of the project layout refactor in Django 1.4 https://docs.djangoproject.com/en/1.4/releases/1.4/#django-core-management-execute-manager. Per the deprecation policy that means that the code for execute_manager has been completely removed in 1.6. If you are seeing this import error then the version of Satchmo you are using has not been updated to be compatible with Django 1.6.

Silvasilvain answered 5/8, 2013 at 0:17 Comment(2)
Thanks a lot!! But how can i locate where to replace it? I replace all imports in 'manage.py's but it seems i miss smth...Conserve
Even if you fix this import, I don't think you will be able to get this working. Satchmo doesn't claim to support Django 1.5 much less 1.6 which is currently in beta.Silvasilvain

© 2022 - 2024 — McMap. All rights reserved.