我尝试运行sudo bin / buildout,我收到以下错误
回溯:
Getting distribution for 'django-cms==2.2'.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 2147, in main
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 2133, in with_ei_usage
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 2150, in <lambda>
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 370, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 594, in easy_install
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 643, in install_item
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 833, in install_eggs
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1055, in build_and_install
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1040, in run_setup
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 63, in run_setup
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 109, in run
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 62, in runner
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 38, in _execfile
File "/tmp/easy_install-Q5iQTO/django-cms-2.2/setup.py", line 3, in <module>
File "/tmp/easy_install-Q5iQTO/django-cms-2.2/cms/__init__.py", line 7, in <module>
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.4-py2.7.egg/django/conf/__init__.py", line 54, in __getattr__
self._setup(name)
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.4-py2.7.egg/django/conf/__init__.py", line 47, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
An error occurred when trying to install django-cms 2.2. Look above this message for any errors that were output by easy_install.
While:
Installing django.
Getting distribution for 'django-cms==2.2'.
Error: Couldn't install: django-cms 2.2
Buildout.cfg:
[versions]
django = 1.3
django-registration = 0.8-alpha-1
django-filebrowser = 3.0-no-grappelli-2
django-cms = 2.2
我尝试使用谷歌搜索,它说当django版本不是1.3时可能会发生此错误,但是这里指定django必须是1.3
任何想法如何解决这个问题?如果您还有其他需要,请告诉我。
答案 0 :(得分:0)
您遇到了一个可以使用全局可导入django.conf.settings
模块的问题。 * {3.0} 之前的django-cms
软件包指望该模块不可在安装期间导入。
在安装过程中,安装脚本导入cms
包以读取版本号,但同样的包也尝试修补Django设置。这仅受ImportError
异常处理程序的保护;例如如果导入django.conf.settings
失败,则不要修改设置。
当你有一个全局Django安装时,导入不会失败,但是会引发一个不同的异常,因为你没有Django配置安装django-cms。
升级到django-cms 3.x或删除全局Django安装。