Django no module named utils

风流意气都作罢 提交于 2019-12-08 00:44:29

问题


I know this question has been asked before but after looking into it I can't help but feel I missed something.

So I previously had a problem getting django-compressor installed but after a bit of struggling i managed to get it installed. When I run my django application though it stops on execute_from_command_line(sys.argv) in my manage.py and throws this error:

Traceback (most recent call last):
  File "C:\Users\PCDOM\Desktop\Power\pm_app\manage.py", line
 17, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\PCDOM\Desktop\Power\pm_app\env\lib\site-pac
kages\django\core\management\__init__.py", line 385, in execute_from_command_lin
e
    utility.execute()
  File "C:\Users\PCDOM\Desktop\Power\pm_app\env\lib\site-pac
kages\django\core\management\__init__.py", line 354, in execute
    django.setup()
  File "C:\Users\PCDOM\Desktop\Power\pm_app\env\lib\site-pac
kages\django\__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\PCDOM\Desktop\Power\pm_app\env\lib\site-pac
kages\django\apps\registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "C:\Users\PCDOM\Desktop\Power\pm_app\env\lib\site-pac
kages\django\apps\config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\Python27\Lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "C:\Users\PCDOM\Desktop\Power\pm_app\env\lib\site-pac
kages\compressor\models.py", line 1, in <module>
    from compressor.conf import CompressorConf  # noqa
  File "C:\Users\PCDOM\Desktop\Power\pm_app\env\lib\site-pac
kages\compressor\conf.py", line 5, in <module>
    from django.template.utils import InvalidTemplateEngineError
ImportError: No module named utils

so when i went to look in the directory, i couldn't find a utils.py file. Isn't that suppose to be part of the django package? Did something not install correctly since I'm missing that file?


回答1:


It looks like that module is new in 1.8. Try upgrading to 1.9



来源:https://stackoverflow.com/questions/35490876/django-no-module-named-utils

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!