# ActiveGate plugin Python dependency

**URL:** <https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400>\
**Category:** Extensions\
**Tags:** activegate, python, extensions\
**Created:** [February 1, 2019, 7:16pm UTC](https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400 "2019-02-01T19:16:58Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![rick\_boyd](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@rick\_boyd](https://community.dynatrace.com/u/rick_boyd)\
**Post date:** [February 1, 2019, 7:16pm UTC](https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400/1 "2019-02-01T19:16:58Z")

</div>

Hi!

I’ve listed my plugin’s dependencies in the `install\_requires’ element of ‘source’ in my ActiveGate remote plugin plugin.json, but it doesn’t seem like the plugin module is installing it. Is there potentially a step I missed, or missing functionality due to this being beta? Where can i check logs for this?

Thanks,

Rick B

---

<div class="post-metadata">

**Author:** ![rick\_boyd](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@rick\_boyd](https://community.dynatrace.com/u/rick_boyd)\
**Post date:** [February 1, 2019, 7:20pm UTC](https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400/2 "2019-02-01T19:20:29Z")

</div>

```auto
2019-02-01 18:46:00.992 UTC [1e7738ef] info [native] 140664985044736(MainThread) - [report_status] new plugin status for engine ('custom.remote.python.kafka.Stats', 0) PluginFullStatus(pluginName=custom.remote.python.kafka.Stats, pluginVersion=0.003, state=ERROR_UNKNOWN, description=No module named 'avro', monitoredEntityId=0x0, stacktrace=Traceback (most recent call last):
   File "/var/opt/dynatrace/gateway/remotepluginmodule/agent/plugin/engine/ruxit/plugin_state_machine.py", line 270, in _execute_next_task
     self._engine.send(None)
   File "/var/opt/dynatrace/gateway/remotepluginmodule/agent/plugin/engine/ruxit/plugin_state_machine.py", line 525, in engine_generator
     plugin_module = importlib.import_module(plugin_engine_instance.metadata["source"]["package"])
   File "/var/opt/dynatrace/gateway/remotepluginmodule/agent/plugin/python3.6/importlib/ __init__.py", line 126, in import_module
     return _bootstrap._gcd_import(name[level:], package, level)
   File "", line 994, in _gcd_import
   File "", line 971, in _find_and_load
   File "", line 955, in _find_and_load_unlocked
   File "", line 665, in _load_unlocked
   File "", line 678, in exec_module
   File "", line 219, in _call_with_frames_removed
   File "/var/opt/dynatrace/gateway/remotepluginmodule/plugin_deployment/kafka-pipeline-plugin/kafka-pipeline-plugin.py", line 5, in
     from avro.io import BinaryDecoder, DatumReader
 ModuleNotFoundError: No module named 'avro'

```

with plugin.json starting:

```auto
{
   "name": "custom.remote.python.kafka.Stats",
   "version": "0.003",
   "type": "python",
   "entity": "CUSTOM_DEVICE",
   "processTypeNames": ["PYTHON"],
   "technologies": ["Kafka Custom Pipeline"],
   "favicon": "https://www.ibm.com/watson/health/favicon.ico",
   "source": {
      "package": "kafka-pipeline-plugin",
      "className": "KafkaPipelinePlugin",
      "install_requires": ["avro","timeit","kafka"],
      "activation": "Remote"
   },
...

```

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [February 2, 2019, 12:53pm UTC](https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400/3 "2019-02-02T12:53:49Z")

</div>

Can you also add the output of oneagent\_build\_plugin?

---

<div class="post-metadata">

**Author:** ![Piotr\_Meller](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@Piotr\_Meller](https://community.dynatrace.com/u/Piotr_Meller)\
**Post date:** [February 4, 2019, 8:26am UTC](https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400/4 "2019-02-04T08:26:04Z")

</div>

Hi Rick,

have you built your plugin using

```auto
oneagent_build_plugin

```

command from Plugin SDK? That should build your plugin with required packages inside.

See Deploy via Plugin SDK:

[https://www.dynatrace.com/support/help/extend-dyna…](https://www.dynatrace.com/support/help/extend-dynatrace/activegate-plugins/plugin-development/activegate-plugins-how-tos/deploy-an-activegate-plugin/)

Peter

> **[Develop your own Extensions](https://docs.dynatrace.com/docs/ingest-from/extensions/develop-your-extensions)**
>
> Develop your own Extensions in Dynatrace.

###

---

<div class="post-metadata">

**Author:** ![rick\_boyd](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@rick\_boyd](https://community.dynatrace.com/u/rick_boyd)\
**Post date:** [February 4, 2019, 1:00pm UTC](https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400/5 "2019-02-04T13:00:22Z")

</div>

thanks Piotr,  
I thought that was only for oneagent plugins, some of the documentation is a little confusing.

---

<div class="post-metadata">

**Author:** ![rick\_boyd](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@rick\_boyd](https://community.dynatrace.com/u/rick_boyd)\
**Post date:** [February 4, 2019, 1:31pm UTC](https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400/6 "2019-02-04T13:31:00Z")

</div>

Hi Piotr,

I previously followed the “manual” version of the deploy instructions there, before posting this question. now i’m trying to follow the sdk version and cannot find where or how to invoke the oneagent\_build\_plugin call, as it doesn’t seem to be on my path as a user on the linux box where my activegate and plugin module were installed, nor does it seem to be the name of any of the files in my install path. do you have direct knowledge of deploying plugins to linux activegates, and where i might be going wrong?

Thanks,

Rick B

---

<div class="post-metadata">

**Author:** ![rick\_boyd](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@rick\_boyd](https://community.dynatrace.com/u/rick_boyd)\
**Post date:** [February 4, 2019, 1:32pm UTC](https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400/7 "2019-02-04T13:32:17Z")

</div>

hi, please see the comments on Piotr’s answer

---

<div class="post-metadata">

**Author:** ![Piotr\_Meller](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@Piotr\_Meller](https://community.dynatrace.com/u/Piotr_Meller)\
**Post date:** [February 4, 2019, 1:46pm UTC](https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400/8 "2019-02-04T13:46:21Z")

</div>

Here is the instruction how to install Plugin SDK:

[https://www.dynatrace.com/support/help/extend-dyna…](https://www.dynatrace.com/support/help/extend-dynatrace/activegate-plugins/plugin-development/activegate-plugin-sdk-overview/)

---

<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:** [February 4, 2019, 5:16pm UTC](https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400/9 "2019-02-04T17:16:43Z")

</div>

Hello Rick,

When you install the Plugin SDK, the install script will put these scripts inside the python /bin directory, side by side with pip, easy\_install, etc.

Of course, if you do not have that directory as part of your path you will not “see” the commands. I recommend you use Python Virtual Environments ([venv — Creation of virtual environments — Python 3.15.2 documentation](https://docs.python.org/3/library/venv.html)) when developing plugins, because this will sort it our for you with no need to change your PATH environment variable or call the scripts manually from the location

---

<div class="post-metadata">

**Author:** ![rick\_boyd](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@rick\_boyd](https://community.dynatrace.com/u/rick_boyd)\
**Post date:** [February 4, 2019, 9:49pm UTC](https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400/10 "2019-02-04T21:49:35Z")

</div>

thanks, i used virtualenv locally for dev and didn’t think to see that on the command line there. i’m not able to get venv set up on the activegate server so i’ll need to try to figure out where the packaged python environment is and work from there on the server. kind of annoying and not really spelled out in the directions where certain things are done, not to mention the manual method written out in the docs doesn’t work when you have required extra modules

---

<div class="post-metadata">

**Author:** ![Piotr\_Meller](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@Piotr\_Meller](https://community.dynatrace.com/u/Piotr_Meller)\
**Post date:** [February 5, 2019, 10:03am UTC](https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400/11 "2019-02-05T10:03:16Z")

</div>

Rick,

you don’t need to install venv on ActiveGate server, it’s enough to have it on your dev machine. Please install Plugin SDK inside you venv and use oneagent\_build\_plugin script to build the plugin. It will create a plugin package, which has to be uploaded to the server - the same script can do that if you provide server address and token. Finally you have to take this built plugin and story it in plugin\_deployment dir on ActiveGate machine.

> **[Develop your own Extensions](https://docs.dynatrace.com/docs/ingest-from/extensions/develop-your-extensions)**
>
> Develop your own Extensions in Dynatrace.

Peter

---

<div class="post-metadata">

**Author:** ![rick\_boyd](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@rick\_boyd](https://community.dynatrace.com/u/rick_boyd)\
**Post date:** [February 5, 2019, 3:38pm UTC](https://community.dynatrace.com/t/activegate-plugin-python-dependency/19400/12 "2019-02-05T15:38:22Z")

</div>

thank you. running into other issues now but this has resolved my dependency problem so i will open a new topic
