PRTG – No module named ‘requests’

We use Paessler’s “PRTG” monitoring and reporting software for keeping tabs on everything here.

We’ve increasingly started writing scripts in Python to serve as “sensors”, feeding data into PRTG, but we’ve hit a couple of road-blocks on the way.

ModuleNotFoundError: No module named ‘requests’

If you encounter this error, or any similar ones reporting “no module named…”, the fix is simple:

  1. First it’s critical that you’re logged in as THE Windows “Administrator”. Logging in as a user who’s a member of the Administrator’s group is insufficient:

  2. Change directory to where python.exe lives:
    CD "C:\Program Files (x86)\PRTG Network Monitor\python\"
    
  3. Install the required module. In this example it's 'requests':
    .\python.exe -m pip install requests

That should be all you need ... with one more potential pitfall: PRTG needs to be running on a release later than 22.2.77.2204:

PRTG Version 22.2.77.2204 broke compatibility with pip.exe install (to install Python packages). With this PRTG release we have removed support for this command to prevent unexpected errors. As of now the only supported way of installing a Python package to use Python Script Advanced sensor is python.exe -m pip install. Please also see our Knowledge Base article for more information about Python installation: https://kb.paessler.com/en/topic/90686.

References / Credits

Revision History

5th November 2022. This is the initial publication.

 
– G.

Leave a Reply

Your email address will not be published. Required fields are marked *

... and please just confirm for me that you're not a bot first: Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.