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

Error Oneagent extension - ModuleNotFoundError: No module named 'pymssql'


Hi all,

I'm working on the plugin to consult MsSql with the pymssql module. But return an error:

2020-07-31 01:38:08.924 UTC [00000390] info [native] 912(MainThread) - [report_status] status changed for engine ('custom.python.microsoftsql', 337135384361100414) PluginFullStatus(pluginName=custom.python.microsoftsql, pluginVersion=1.01, state=ERROR_UNKNOWN, description=No module named 'pymssql', monitoredEntityId=0x4adbed88a0ee47e, stacktrace=Traceback (most recent call last):

File "C:/ProgramData/dynatrace/oneagent/agent/runtime/engine_unpacked\ruxit\", line 340, in _execute_next_task


File "C:/ProgramData/dynatrace/oneagent/agent/runtime/engine_unpacked\ruxit\", line 665, in _query_plugin

self._plugin_run_data = self._create_plugin_run_data()

File "C:/ProgramData/dynatrace/oneagent/agent/runtime/engine_unpacked\ruxit\", line 640, in _create_plugin_run_data

plugin_module = importlib.import_module(self.metadata["source"]["package"])

File "D:/dynatrace/oneagent/agent/plugin/python3.6\importlib\", line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "<frozen importlib._bootstrap>", line 994, in _gcd_import

File "<frozen importlib._bootstrap>", line 971, in _find_and_load

File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

File "<frozen importlib._bootstrap_external>", line 678, in exec_module

File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

File "D:/dynatrace/oneagent/plugin_deployment/custom.python.microsoftsql\", line 2, in <module>

import pymssql

ModuleNotFoundError: No module named 'pymssql'



Dynatrace Helper
Dynatrace Helper

It looks like your custom plugin does not have pymssql . Please check in plugin.json, section "source", "install_requires" if it's added there. For example in demo_activegate_plugin (avaiable in examples) package requests is included:

  "source": {
"package": "demo_activegate_plugin",
"className": "DemoPluginRemote",
"install_requires": ["requests>=2.6.0"],
"activation": "Remote"

After you include this package don't forget to increase version of your plugin and rebuild it.

Hi Maciej,

yes, I configured this parameter.

"technologies": ["MSSQL"],

"source": {

"package": "plugin_sql",

"className": "MsSql_Custom",

"install_requires": ["pymssql"],

"activation": "Singleton"


Dynatrace Helper
Dynatrace Helper

Can you check plugin build output? And if build plugin in plugin_deployment has the pymssql library?