Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named 'alignak_webui' #377

Open
bbcorp opened this issue Feb 10, 2019 · 3 comments
Open

ImportError: No module named 'alignak_webui' #377

bbcorp opened this issue Feb 10, 2019 · 3 comments

Comments

@bbcorp
Copy link

bbcorp commented Feb 10, 2019

Hey there,
I just installed alignak & alignak-webui on debian 9 from https://dl.bintray.com/alignak/alignak-deb-stable
alignak runs fine but alignak-webui throw an error about alignak_webui module :

ImportError: No module named 'alignak_webui'
unable to load app 0 (mountpoint='') (callable not found or import error)
Traceback (most recent call last):
  File "/usr/local/share/alignak-webui/etc/alignak-webui.wsgi", line 6, in <module>
    from alignak_webui.app import session_app as application

I installed theses packages : python3-alignak python3-alignak-backend python3-alignak-webui
I also tried installing alignak-webui with pip3 but it's not better.
Do you have a clue ?

EDIT: here's package version :
python3-alignak : 2.1.2
python3-alignak-backend : 1.4.16
python3-alignak-webui : 0.12.0

@mohierf
Copy link
Contributor

mohierf commented Feb 12, 2019

Hi
The wsgi configuration file requires that you indicate where uWSGI can load the alignak_webui module. The dafult configuration is loading: from alignak_webui.app import session_app as application which is the most common install location ... but it may be installed in a different place that is not in the default Python path

Search for a directory alignak_webui on your system and update the wsgi file accordingly... the insatlled wsgi file states:

# Uncomment and update to force a specific Python interpreter
# Else, let use the default system Python interpreter
# import sys
# sys.path.append('/usr/local/lib/python2.7/site-packages/alignak_webui')

from alignak_webui.app import session_app as application

@bbcorp
Copy link
Author

bbcorp commented Mar 6, 2019

Hi Frédéric,
I had it running with path like this without alignak_webui directory :
sys.path.append('/usr/local/lib/python3.6/site-packages')

Maybe full path will work by modifying import to (I didn't try it) :
from app import session_app as application

By the way my problem is caused by having python2.7 and python3.x at the same time and python is still searching in 2.7 packages.
I'll keep digging in order to fix this problem :-)

@Jorilx
Copy link

Jorilx commented Apr 5, 2020

This happens because the deb files for Alignak install it inside /usr/local/lib/pythonX.Y/site-packages, but Debian's Python do not use site-packages by default, only dist-packages (see here). So indeed you have to tell Python to look there too, I think the easiest way is to just set PYTHONPATH:
PYTHONPATH=/usr/local/lib/python3.6/site-packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants