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

Extension V2 Python dependencies ModuleNotFoundError: No module named 'requests'

jannickdeturck
Visitor

I migrated a custom python v1 extension to v2.
I uploaded the zip file to my dynatrace tenant. When adding a configuration to this extension, I see in the logs the following:

[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3080585][err]Traceback (most recent call last):
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3080585][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3080585][err]    return _run_code(code, main_globals, None,
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3080585][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 86, in _run_code
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3080585][err]    exec(code, run_globals)
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3080585][err]  File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/custom_nonauthhealtcheck_0.0.1/lib/python3.10/site-packages/nonauthhealtcheck/__main__.py", line 6, in <module>
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3080585][err]    import requests
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3080585][err]ModuleNotFoundError: No module named 'requests'
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081087][err]Traceback (most recent call last):
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081087][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081087][err]    return _run_code(code, main_globals, None,
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081087][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 86, in _run_code
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081087][err]    exec(code, run_globals)
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081087][err]  File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/custom_nonauthhealtcheck_0.0.1/lib/python3.10/site-packages/nonauthhealtcheck/__main__.py", line 6, in <module>
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081087][err]    import requests
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081087][err]ModuleNotFoundError: No module named 'requests'
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081627][err]Traceback (most recent call last):
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081627][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081627][err]    return _run_code(code, main_globals, None,
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081627][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 86, in _run_code
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081627][err]    exec(code, run_globals)
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081627][err]  File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/custom_nonauthhealtcheck_0.0.1/lib/python3.10/site-packages/nonauthhealtcheck/__main__.py", line 6, in <module>
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081627][err]    import requests
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3081627][err]ModuleNotFoundError: No module named 'requests'
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082136][err]Traceback (most recent call last):
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082136][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082136][err]    return _run_code(code, main_globals, None,
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082136][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 86, in _run_code
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082136][err]    exec(code, run_globals)
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082136][err]  File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/custom_nonauthhealtcheck_0.0.1/lib/python3.10/site-packages/nonauthhealtcheck/__main__.py", line 6, in <module>
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082136][err]    import requests
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082136][err]ModuleNotFoundError: No module named 'requests'
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082650][err]Traceback (most recent call last):
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082650][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082650][err]    return _run_code(code, main_globals, None,
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082650][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 86, in _run_code
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082650][err]    exec(code, run_globals)
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082650][err]  File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/custom_nonauthhealtcheck_0.0.1/lib/python3.10/site-packages/nonauthhealtcheck/__main__.py", line 6, in <module>
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082650][err]    import requests
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3082650][err]ModuleNotFoundError: No module named 'requests'
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3258][err]Traceback (most recent call last):
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3258][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3258][err]    return _run_code(code, main_globals, None,
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3258][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 86, in _run_code
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3258][err]    exec(code, run_globals)
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3258][err]  File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/custom_nonauthhealtcheck_0.0.1/lib/python3.10/site-packages/nonauthhealtcheck/__main__.py", line 6, in <module>
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3258][err]    import requests
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3258][err]ModuleNotFoundError: No module named 'requests'
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3831][err]Traceback (most recent call last):
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3831][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3831][err]    return _run_code(code, main_globals, None,
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3831][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 86, in _run_code
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3831][err]    exec(code, run_globals)
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3831][err]  File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/custom_nonauthhealtcheck_0.0.1/lib/python3.10/site-packages/nonauthhealtcheck/__main__.py", line 6, in <module>
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3831][err]    import requests
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][3831][err]ModuleNotFoundError: No module named 'requests'
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4397][err]Traceback (most recent call last):
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4397][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4397][err]    return _run_code(code, main_globals, None,
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4397][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 86, in _run_code
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4397][err]    exec(code, run_globals)
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4397][err]  File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/custom_nonauthhealtcheck_0.0.1/lib/python3.10/site-packages/nonauthhealtcheck/__main__.py", line 6, in <module>
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4397][err]    import requests
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4397][err]ModuleNotFoundError: No module named 'requests'
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4970][err]Traceback (most recent call last):
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4970][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4970][err]    return _run_code(code, main_globals, None,
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4970][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 86, in _run_code
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4970][err]    exec(code, run_globals)
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4970][err]  File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/custom_nonauthhealtcheck_0.0.1/lib/python3.10/site-packages/nonauthhealtcheck/__main__.py", line 6, in <module>
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4970][err]    import requests
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][4970][err]ModuleNotFoundError: No module named 'requests'
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][5534][err]Traceback (most recent call last):
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][5534][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][5534][err]    return _run_code(code, main_globals, None,
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][5534][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 86, in _run_code
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][5534][err]    exec(code, run_globals)
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][5534][err]  File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/custom_nonauthhealtcheck_0.0.1/lib/python3.10/site-packages/nonauthhealtcheck/__main__.py", line 6, in <module>
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][5534][err]    import requests
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][5534][err]ModuleNotFoundError: No module named 'requests'
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6098][err]Traceback (most recent call last):
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6098][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6098][err]    return _run_code(code, main_globals, None,
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6098][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 86, in _run_code
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6098][err]    exec(code, run_globals)
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6098][err]  File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/custom_nonauthhealtcheck_0.0.1/lib/python3.10/site-packages/nonauthhealtcheck/__main__.py", line 6, in <module>
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6098][err]    import requests
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6098][err]ModuleNotFoundError: No module named 'requests'
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6664][err]Traceback (most recent call last):
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6664][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6664][err]    return _run_code(code, main_globals, None,
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6664][err]  File "/opt/dynatrace/remotepluginmodule/agent/res/dsruntime/python3.10/lib/python3.10/runpy.py", line 86, in _run_code
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6664][err]    exec(code, run_globals)
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6664][err]  File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/custom_nonauthhealtcheck_0.0.1/lib/python3.10/site-packages/nonauthhealtcheck/__main__.py", line 6, in <module>
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6664][err]    import requests
[e077de86-437c-3279-aebf-9018a207bb2a][f_-7887671099770936204][6664][err]ModuleNotFoundError: No module named 'requests'

in the setup.py

jannickdeturck_1-1728629085286.png


So can somebody explain me what I am doing wrong?

 



1 REPLY 1

michal_lewi
Helper

Hello @jannickdeturck,
add requests to requires:
install_requires=["dt-extensions-sdk","requests"],

also check that you are compile your extension to same operating system. If not you need to add extra flag to your build command:

dt-sdk build --extra-platform manylinux2014_x86_64
dt-sdk build --extra-platform win_amd64

Building Extensions — dt-sdk 1.0.0 documentation (dynatrace-extensions.github.io)

Best Regards

 

Featured Posts