horizon project execution problem ( import settings )

Asked by gokhan on 2013-11-20

I download the horizon project from github and open it by using eclipse IDE as a django project. Then I run the project but got some errors like:

Warning: Could not import Horizon dependencies. This is normal during installation.
Traceback (most recent call last):
  File "/home/gokhan/git/horizon/manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 261, in fetch_command
    commands = get_commands()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 107, in get_commands
    apps = settings.INSTALLED_APPS
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 54, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 49, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 132, in __init__
    % (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'horizon.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named settings

Any help?

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Dashboard (Horizon) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
David Lyle (david-lyle) said : #1

I believe you are missing openstack_dashboard/local/local_settings.py. To start, you can copy the local_settings.py.example, but the Keystone endpoints will have to change. The setting is AVAILABLE_REGIONS.

gokhan (gokhankcmn) said : #2

I have local_settings.py file now.
But a different problem I have now:

Warning: Could not import Horizon dependencies. This is normal during installation.
Traceback (most recent call last):
  File "/home/gokhan/git/horizon/manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 261, in fetch_command
    commands = get_commands()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 107, in get_commands
    apps = settings.INSTALLED_APPS
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 54, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 49, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 128, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/home/gokhan/git/horizon/horizon/__init__.py", line 55, in <module>
    assert Dashboard
NameError: name 'Dashboard' is not defined

gokhan (gokhankcmn) said : #3

Hi,

I tried to find the main problem and carefully pursue the steps and found that problem is installing horizon dependencies.
When I try to install dependencies by using command below:

python tools/install_venv.py

I got that:

In file included from greenlet.c:5:0:

greenlet.h:8:20: fatal error: Python.h: No such file or directory

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /home/gokhan/git/horizon/.venv/bin/python -c "import setuptools;__file__='/home/gokhan/git/horizon/.venv/build/greenlet/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-AekllV-record/install-record.txt --single-version-externally-managed --install-headers /home/gokhan/git/horizon/.venv/include/site/python2.7 failed with error code 1 in /home/gokhan/git/horizon/.venv/build/greenlet
Traceback (most recent call last):
  File "/home/gokhan/git/horizon/.venv/bin/pip", line 9, in <module>
    load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
  File "/home/gokhan/git/horizon/.venv/local/lib/python2.7/site-packages/pip/__init__.py", line 148, in main
    return command.main(args[1:], options)
  File "/home/gokhan/git/horizon/.venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 169, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 66: ordinal not in range(128)
Command "tools/with_venv.sh pip install --upgrade -r /home/gokhan/git/horizon/requirements.txt" failed.

Rob Raymond (rob-raymond) said : #4

You are going to need to install python-dev to get the header file Python.h

apt-get install python-dev

Hopefully that will get you further.

Can you help with this problem?

Provide an answer of your own, or ask gokhan for more information if necessary.

To post a message you must log in.