0

I have a remote server which have installed RHEL 5 and Python2.

OS Version:
Red Hat Enterprise Linux Server release 5 (Tikanga)

Python Version:
Python 2.4.3

I could find the rrdtool have installed on following path as well.

/usr/local/rrdtool/bin

But when I execute following command in a .py file I am getting an error.

import sys
import rrdtool

Error:

import rrdtool
ImportError: No module named rrdtool

Can someone explain why I am getting this error and how to overcome this?

Shehan
  • 417
  • 2
  • 11

1 Answers1

0

Python expects a python library. The directory /usr/local/rrdtool/ contains the rrdtool binary, but not the bindings to use it in Python.

You need to install the matching python library, using pip for instance :

pip install python-rrdtool
ibi0tux
  • 2,481
  • 4
  • 28
  • 49
  • I have used sudo yum install python-rrdtool instead of pip install. I am getting error: No Match for argument: python-rrdtool Nothing to do – Shehan May 17 '22 at 15:51
  • Yum is an utility for managing system packages, not python libraries. Probably there's no such `python-rrdtool` in yum packages list. Pip will look for python packages on a dedicated repository. – ibi0tux May 18 '22 at 07:19
  • my remote server have not installed pip as well. – Shehan May 18 '22 at 10:37