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

ModuleNotFoundError: No module named 'prometheus_client' #43

Open
gbeyer3 opened this issue Aug 11, 2021 · 2 comments
Open

ModuleNotFoundError: No module named 'prometheus_client' #43

gbeyer3 opened this issue Aug 11, 2021 · 2 comments

Comments

@gbeyer3
Copy link

gbeyer3 commented Aug 11, 2021

Hello, I'm getting an error when attempting to start the infiniband exporter service:

Started Infiniband_exporter.
Aug 11 14:20:42 <nodename> python3[374627]: Traceback (most recent call last):
Aug 11 14:20:42 <nodename> python3[374627]: File "/usr/bin/infiniband_exporter.py", line 12, in
Aug 11 14:20:42 <nodename> python3[374627]: from prometheus_client.core import CounterMetricFamily, GaugeMetricFamily
Aug 11 14:20:42 <nodename> python3[374627]: ModuleNotFoundError: No module named 'prometheus_client'
Aug 11 14:20:42 <nodename> systemd[1]: infiniband_exporter.service: main process exited, code=exited, status=1/FAILURE
Aug 11 14:20:42 <nodename> systemd[1]: Unit infiniband_exporter.service entered failed state.
Aug 11 14:20:42 <nodename> systemd[1]: infiniband_exporter.service failed.

Is there a dependency that I am missing - CounterMetricFamily, GaugeMetricFamily ? If so, where do I get it?

i'm using v 0.0.4

Thanks

@guilbaults
Copy link
Owner

Hi,
This module currently need to be installed manually with pip3 install prometheus-client.

python2 support for this program was removed in the latest release, previously this was using python2-prometheus_client from epel to provide this module and there are no python3-prometheus_client available on Centos 7.

A small warning was placed in the README.md in this commit 20dcf98

The upstream module:
https://pypi.org/project/prometheus-client/

@gabrieleiannetti
Copy link
Contributor

gabrieleiannetti commented Aug 12, 2021

Hi,

you can also use Miniconda for resolving dependencies in Python.
It is a great tool. I just use the installer and then manage the dependencies.
With that you can also get different Python versions and environments running easily.

I have written some notes about that here.

The prometheus_client is also available there:

$ conda search prometheus
prometheus. Search: *prometheus*
# Name                       Version           Build  Channel             
...        
prometheus_client             0.10.0    pyhd3eb1b0_0  pkgs/main           
prometheus_client             0.10.1    pyhd3eb1b0_0  pkgs/main           
prometheus_client             0.11.0    pyhd3eb1b0_0  pkgs/main 

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