Question

Je viens donc mis à jour django à 1.2.3 et maintenant quand je tente de lancer « manage.py shell python » pour travailler dans l'environnement de django, j'obtiens l'erreur suivante.

Traceback (most recent call last):


File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/opt/local/lib/python2.5/site-packages/django/core/management/commands/shell.py", line 18, in handle_noargs
    loaded_models = get_models()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/models/loading.py", line 167, in get_models
    self._populate()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/models/loading.py", line 64, in _populate
    self.load_app(app_name)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/models/loading.py", line 78, in load_app
    models = import_module('.models', app_name)
  File "/opt/local/lib/python2.5/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/local/lib/python2.5/site-packages/django_celery-2.0.3-py2.5.egg/djcelery/models.py", line 7, in <module>
    from celery import conf
  File "/opt/local/lib/python2.5/site-packages/celery-2.0.3-py2.5.egg/celery/conf.py", line 6, in <module>
    from celery import routes
  File "/opt/local/lib/python2.5/site-packages/celery-2.0.3-py2.5.egg/celery/routes.py", line 2, in <module>
    from celery.utils import instantiate, firstmethod, mpromise
  File "/opt/local/lib/python2.5/site-packages/celery-2.0.3-py2.5.egg/celery/utils/__init__.py", line 9, in <module>
    import importlib
ImportError: No module named importlib

Toutes les idées. Je ne peux pas sembler trouver ce qui se passe ici et pour tout ce que je peux dire que je suis en cours d'exécution les mêmes versions sur mon serveur web et je n'ai pas la même erreur montrant.

Était-ce utile?

La solution

importlib qui a été ajouté en Python 2.7 / 3.1, je crois. Vous pouvez télécharger un port pour 2,5 pyton ici:

Vérifiez également setup.cfg pour le céleri près du fond et assurez-vous toutes les autres exigences sont remplies (vers le bas du script).

Autres conseils

importlib a été ajouté à Python dans la version 3.1, puis backported à Python 2.7. backports tiers sont disponibles sur PyPI.

Notez également que « rétroportés à 2,7 » ne signifie pas que toutes les versions 2.7 après auront importlib. Python 3.0, je crois, fait pas ont importlib.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top