Extensions
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python Extension SDK - Why pyodbc doesn't get installed on ActiveGates Python runtime environment.

chris_cho
Helper

Hello,

I am using Dynatrace Python Extension SDK to create a custom extension ingesting data from a SQL server, by using pyodbc Python library. For this I have the configuration:

  • development workstation - Python 3.10
  • use pyodbc 5.2.0 library - this requires Python >= 3.9
  • tenant ActiveGates Python 3.6

I added in the ./setup.py file the pyodbc:
install_requires=["dt-extensions-sdk", "requests", "pyodbc==5.2.0"],

Built successfully the extension distribution package using:
dt-sdk build
and uploaded it to the tenant.
I set a monitoring configuration, and running it I am getting the exception:
"Failed to assign monitoring configuration to ActiveGate. Reason:" -- no reason mentioned.

I checked the log file python3.log in ActiveGates, related to this extension and it looks like
[err] import pyodbc
[err]ModuleNotFoundError: No module named 'pyodbc'
[err]Traceback (most recent call last):
[err] File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
[err] return _run_code(code, main_globals, None,
[err] File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 86, in _run_code
[err] exec(code, run_globals)
. . .   . . .   . . .
I checked whether the pyodbc was installed as supposed to be in the Python runtime environment
$ cd /opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/bin
$ pip show pyodbc

but nothing came up.
Not sure why the pyodbc library did not get installed in the the Python runtime environment.

Please let me know if you have any suggestions.

Thank you,
Chris

1 REPLY 1

AntonioSousa
DynaMight Guru
DynaMight Guru

@chris_cho ,

It seems OK. Please check in extension.zip if the pyodbc wheel is included?

Antonio Sousa

Featured Posts