0

在 Windows 机器上运行pip install django===1.4 django-cms south,按照此处找到的说明返回此错误:

Downloading/unpacking Django==1.4
  Downloading Django-1.4.tar.gz (7.6MB): 7.6MB downloaded
  Running setup.py egg_info for package Django

Downloading/unpacking django-cms
  Running setup.py egg_info for package django-cms
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "c:\users\shadow\appdata\local\temp\pip-build-Shadow\django-cms\setup
.py", line 3, in <module>
        import cms
      File "cms\__init__.py", line 7, in <module>
        if 'cms' in settings.INSTALLED_APPS:
      File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 53, in
__getattr__
        self._setup(name)
      File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 46, in
_setup
        % (desc, ENVIRONMENT_VARIABLE))
    django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APP
S, but settings are not configured. You must either define the environment varia
ble DJANGO_SETTINGS_MODULE or call settings.configure() before accessing setting
s.
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "c:\users\shadow\appdata\local\temp\pip-build-Shadow\django-cms\setup.py"
, line 3, in <module>

    import cms

  File "cms\__init__.py", line 7, in <module>

    if 'cms' in settings.INSTALLED_APPS:

  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 53, in __ge
tattr__

    self._setup(name)

  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 46, in _set
up

    % (desc, ENVIRONMENT_VARIABLE))

django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, b
ut settings are not configured. You must either define the environment variable
DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

----------------------------------------
Command python setup.py egg_info failed with error code 1 in c:\users\shadow\app
data\local\temp\pip-build-Shadow\django-cms
Storing complete log in C:\Users\Shadow\pip\pip.log

Django 和 apache 以及其他一切都运行良好。据我所知,这种错误应该只发生在您实际尝试运行 django 时,而不是尝试安装插件/应用程序。关于导致此错误的原因有什么想法吗?

4

1 回答 1

1

这是一个已知问题,将在接下来的 3 天内通过 2.3.6 版本修复。即将发布的 2.4 版本也不会出现此问题。

于 2013-04-05T20:53:25.367 回答