ImportError: No module named myplugin

asked 2016-08-17 12:20:53 -0500

dyutiman gravatar image

I was following Openstack plugin development tutorial (http://docs.openstack.org/developer/horizon/tutorials/plugin.html (http://docs.openstack.org/developer/h...)) to make a dummy plugin. I completed all the steps including installing my plugin

Processing /home/stack/myplugin/dist/myplugin-1.0.tar.gz
Installing collected packages: myplugin
  Running setup.py install for myplugin ... done
Successfully installed myplugin-1.0

I checked the .venv/lib/python2.7/site-packages/ folder and myplugin is there. Then I did ./run_tests.sh --runserver 10.0.2.15:8877 to start the server on 8877 port. When I went to the url http://127.0.0.1:8877/identity/, I am getting following error

You have offline compression enabled but key "f19ff7906361fa39856f41612174682f" is missing from offline manifest. You may need to run "python manage.py compress".

In the console when I tried python manage.py compress I got following error

stack@ubuntu:/opt/stack/horizon$ python manage.py compress
Traceback (most recent call last):
  File "manage.py", line 23, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/opt/stack/horizon/openstack_dashboard/settings.py", line 378, in <module>
    INSTALLED_APPS,
  File "/opt/stack/horizon/openstack_dashboard/utils/settings.py", line 122, in update_dashboards
    module = import_module(_app)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named myplugin

When I tried uninstalling my plugin with pip uninstall myplugin I got "Cannot uninstall requirement myplugin, not installed".

I installed openstack by devstack running on Ubuntu on virtual box.

Can anybody please guide me to find out what I have done wrong, or where I shall check for mistakes. I rechecked about the file names and folder structure. My _31000_myplugin.py looks like

# The name of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'mypanel'

# The name of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'identity'

# Python panel class of the PANEL to be added.
ADD_PANEL = 'myplugin.content.mypanel.panel.MyPanel'

# A list of applications to be prepended to INSTALLED_APPS
ADD_INSTALLED_APPS = ['myplugin']

# A list of AngularJS modules to be loaded when Angular bootstraps.
ADD_ANGULAR_MODULES = ['horizon.dashboard.identity.myplugin.mypanel']

# Automatically discover static resources in installed apps
AUTO_DISCOVER_STATIC_FILES = True

# A list of js files to be included in the compressed set of files
ADD_JS_FILES = []

# A list of scss files to be included in the compressed set of files
ADD_SCSS_FILES = ['dashboard/identity/myplugin/myplugin.scss']

Thanks in advance.

edit retag flag offensive close merge delete