Django 没有名为 "compressor" 的模块

Django no module named "compressor"

我正在尝试使用 cmd 创建一个超级用户,但每次我 运行 我得到的命令:

C:\Users\PCDOM\Desktop\Power\pm_app>python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 17, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
338, in execute_from_command_line
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
312, in execute
    django.setup()
  File "C:\Python27\lib\site-packages\django\__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Python27\lib\site-packages\django\apps\registry.py", line 85, in popu
late
    app_config = AppConfig.create(entry)
  File "C:\Python27\lib\site-packages\django\apps\config.py", line 86, in create

    module = import_module(entry)
  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named compressor

尽管我已经在我的虚拟环境和我的 settings.py:

中安装了它

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    #'bootstrap3',
    'promo',
    'ums',
    'compressor',
    #'sqlserver_ado',
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    'django.contrib.admindocs',
)

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    #'django.contrib.staticfiles.finders.DefaultStorageFinder',
    'compressor.finders.CompressorFinder',
)

django 对我发脾气有什么原因吗?

我几乎不得不使用我的本地 pip 安装 django-compressor,所以出于某种原因它没有使用我的虚拟环境压缩器

您需要在您的 Venv

中重新安装 django_compressor
 pip install django_compressor