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 zabbix.api #25

Open
nikolaev-rd opened this issue Jan 31, 2019 · 3 comments
Open

ImportError: No module named zabbix.api #25

nikolaev-rd opened this issue Jan 31, 2019 · 3 comments

Comments

@nikolaev-rd
Copy link

To avoid this error

Traceback (most recent call last):
  File "tools/register_st2_config_to_zabbix.py", line 6, in <module>
    from zabbix.api import ZabbixAPI
ImportError: No module named zabbix.api

when execute script

/opt/stackstorm/packs/zabbix/tools/register_st2_config_to_zabbix.py

first you need to install py-zabbix python module:

pip install py-zabbix

Maybe this help somebody, I think it would be usefull to add this steps to Installation section.

@Kami
Copy link
Contributor

Kami commented Jan 31, 2019

As per docs, you need to use Python binary from the pack virtual environment which contains the correct dependencies.

You either need to source source /opt/stackstorm/virtualenvs/zabbix/bin/activate script first or use Python binary from that virtualenv directly:

/opt/stackstorm/virtualenvs/zabbix/bin/python /opt/stackstorm/packs/zabbix/tools/register_st2_config_to_zabbix.py

I will also update the pack documentation to make that very explicit and clear.

@Kami
Copy link
Contributor

Kami commented Jan 31, 2019

Hopefully this will make it more clear in the future - 163c74b.

I also changed it to a single line since it's less error prone if you only copy a single line (aka you don't copy "source" line).

@nikolaev-rd
Copy link
Author

In my case I execute command from Zabbix host (no one StackStorm here).

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

2 participants