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

**URL:** <https://community.dynatrace.com/t/python-extension-sdk-why-pyodbc-doesnt-get-installed-on-activegates-python-runtime-environment/54491>\
**Category:** Extensions\
**Tags:** databases, sql, python, extensions\
**Created:** [December 26, 2025, 4:40am UTC](https://community.dynatrace.com/t/python-extension-sdk-why-pyodbc-doesnt-get-installed-on-activegates-python-runtime-environment/54491 "2025-12-26T04:40:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris\_cho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chris_cho/32/23527_2.png) [@chris\_cho](https://community.dynatrace.com/u/chris_cho)\
**Post date:** [December 26, 2025, 4:40am UTC](https://community.dynatrace.com/t/python-extension-sdk-why-pyodbc-doesnt-get-installed-on-activegates-python-runtime-environment/54491/1 "2025-12-26T04:40:26Z")

</div>

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&nbsp; **python3.log** &nbsp;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)_  
. . .&nbsp; &nbsp;. . .&nbsp; &nbsp;. . .  
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&nbsp;the Python runtime environment.

Please let me know if you have any suggestions.

Thank you,  
Chris

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [December 26, 2025, 9:50am UTC](https://community.dynatrace.com/t/python-extension-sdk-why-pyodbc-doesnt-get-installed-on-activegates-python-runtime-environment/54491/2 "2025-12-26T09:50:33Z")

</div>

[@chris\_cho](https://community.dynatrace.com/user/84142)&nbsp;,

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

---

<div class="post-metadata">

**Author:** ![chris\_cho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chris_cho/32/23527_2.png) [@chris\_cho](https://community.dynatrace.com/u/chris_cho)\
**Post date:** [December 28, 2025, 8:19pm UTC](https://community.dynatrace.com/t/python-extension-sdk-why-pyodbc-doesnt-get-installed-on-activegates-python-runtime-environment/54491/3 "2025-12-28T20:19:34Z")

</div>

It looks like the **pyodbc** doesn’t work as expected.

 ![chris_cho_0-1766873522367.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/c/5c4adafaacb92ffcda326d2ae29aa5a87d214836.png)

Instead, I tried&nbsp; **pypyodbc** &nbsp;that was distributed to ActiveGates, but it raised other exception about not finding the files for _{ODBC Driver 17 for SQL Server}_ and _{SQL Server Native Client 11.0}_.

Not sure if I am getting anywhere using the **Dynatrace Python Extensions SDK** interacting with any SQL data (SQL Server, Oracle, MySQL, PostgreSQL, others).

---

<div class="post-metadata">

**Author:** ![david\_lopes](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/david_lopes/32/27273_2.png) [@david\_lopes](https://community.dynatrace.com/u/david_lopes)\
**Post date:** [December 28, 2025, 9:24pm UTC](https://community.dynatrace.com/t/python-extension-sdk-why-pyodbc-doesnt-get-installed-on-activegates-python-runtime-environment/54491/4 "2025-12-28T21:24:10Z")

</div>

You can get anywhere you want, we do it for plenty of extensions.

As you can see on the screenshot that you highlighted you have pyodbc for windows, that will never work on a linux AG.

You need to either build on the same architecture or use the --extra-platform flag when building

And of course you don’t really need to mess with this because we have a SQL datasource, that can connect to any database using JDBC.

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [December 28, 2025, 10:26pm UTC](https://community.dynatrace.com/t/python-extension-sdk-why-pyodbc-doesnt-get-installed-on-activegates-python-runtime-environment/54491/5 "2025-12-28T22:26:30Z")

</div>

[@david\_lopes](https://community.dynatrace.com/user/4044)&nbsp;.

From&nbsp;[@chris\_cho](https://community.dynatrace.com/user/84142)&nbsp;details, it’s clear he has a Linux AG. But, if it were a Windows AG, it would work, right?

---

<div class="post-metadata">

**Author:** ![david\_lopes](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/david_lopes/32/27273_2.png) [@david\_lopes](https://community.dynatrace.com/u/david_lopes)\
**Post date:** [December 28, 2025, 11:58pm UTC](https://community.dynatrace.com/t/python-extension-sdk-why-pyodbc-doesnt-get-installed-on-activegates-python-runtime-environment/54491/6 "2025-12-28T23:58:21Z")

</div>

Yes sorry, good catch!

I forgot the word linux there, fixing it.

---

<div class="post-metadata">

**Author:** ![chris\_cho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chris_cho/32/23527_2.png) [@chris\_cho](https://community.dynatrace.com/u/chris_cho)\
**Post date:** [December 29, 2025, 5:56am UTC](https://community.dynatrace.com/t/python-extension-sdk-why-pyodbc-doesnt-get-installed-on-activegates-python-runtime-environment/54491/7 "2025-12-29T05:56:46Z")

</div>

Hello&nbsp;[@david\_lopes](https://community.dynatrace.com/user/4044)&nbsp;and&nbsp;[@AntonioSousa](https://community.dynatrace.com/user/17213),  
Thank you both for your reply.

Indeed, I thought it will be way easier using the Python ODBC libraries, such as _ **pyodbc** _ and _ **pypyodbc** _, but for distributing it for Linux ActiveGates is not that simple and straightforward.  
Additionally, there is a need installing ODBC drivers “ **unixODBC** ”, “ **unixODBC-devel** ”.  
Besides,&nbsp;connecting to MS SQL Server, **pypyodbc** &nbsp;needs to install _ **FreeTDS** _ (Tabular Data Stream), included in&nbsp; **/etc/odbcinst.ini**

 ![chris_cho_1-1766985632096.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/7/077feff5329ff0c6688865e9b228082c765ccfc7.png)

**./setup.py**

![chris_cho_0-1766985376890.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/aa6dfcdd98d3680a7d8cc12cf41289f8ac2dc68e.png)

I used it, but now I am getting another exception message:&nbsp;  
_(‘01000’, “[01000] [unixODBC][Driver Manager]Can’t open lib ‘/usr/lib64/ **libtdsodbc.so** ’ : file not found”)_

Perhaps I need to move FreeTDS to _ **extras\_require** _ in the **./setup.py** file.

---

<div class="post-metadata">

**Author:** ![chris\_cho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chris_cho/32/23527_2.png) [@chris\_cho](https://community.dynatrace.com/u/chris_cho)\
**Post date:** [December 29, 2025, 6:03am UTC](https://community.dynatrace.com/t/python-extension-sdk-why-pyodbc-doesnt-get-installed-on-activegates-python-runtime-environment/54491/8 "2025-12-29T06:03:44Z")

</div>

Unfortunately, I cannot get the Python libraries from an external repo, than the organization’s repo.  
For now, The only ODBC package available for me is **pypyodbc** , for both Windows and Linux.

---

<div class="post-metadata">

**Author:** ![chris\_cho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chris_cho/32/23527_2.png) [@chris\_cho](https://community.dynatrace.com/u/chris_cho)\
**Post date:** [December 31, 2025, 3:15pm UTC](https://community.dynatrace.com/t/python-extension-sdk-why-pyodbc-doesnt-get-installed-on-activegates-python-runtime-environment/54491/9 "2025-12-31T15:15:53Z")

</div>

Hello&nbsp;[@david\_lopes](https://community.dynatrace.com/user/4044)&nbsp;and [@AntonioSousa](https://community.dynatrace.com/user/17213),

Definitely, I would prefer an out-of-the-box solution, than reinventing the wheel.  
So far, by using SQL extension, I couldn’t find the way to extract a potential large data based on **batches** , neither on **checkpoints**. Are there other ways to use the SQL data sources, through JDBC, than the SQL extensions?

On the other hand, exploring Python Extensions SDK, I am a step ahead, but still not there yet.  
For this stage, I created another question  
[Python Extension SDK fails connecting to MS SQL Server by using Windows Authentication - Linux AGs](https://community.dynatrace.com/topic/292331)
