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

Python 2.0 extension Init workspace error

trevordconsult
Visitor

Good afternoon all, I am trying to setup a python 2.0 extension and every time I initialize the workspace I get this error.

 

2024-04-26T21:23:49.993Z [ERROR][dynatrace-extensions.initWorkspace] Unexpected error: Traceback (most recent call last):
  File "c:\users\aab0142\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\aab0142\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\userid\AppData\Local\Programs\Python\Python38\Scripts\dt-sdk.exe\__main__.py", line 4, in <module>
  File "c:\users\userid\appdata\local\programs\python\python38\lib\site-packages\dynatrace_extension\__init__.py", line 11, in <module>
    from .sdk.extension import DtEventType, Extension
  File "c:\users\userid\appdata\local\programs\python\python38\lib\site-packages\dynatrace_extension\sdk\extension.py", line 85, in <module>
    class CountMetricRegistrationEntry(NamedTuple):
  File "c:\users\userid\appdata\local\programs\python\python38\lib\site-packages\dynatrace_extension\sdk\extension.py", line 88, in CountMetricRegistrationEntry
    dimensions_list: list[str]
TypeError: 'type' object is not subscriptable
 
I have generated new certificates and also published them to dynatrace. I still get the same error. I would also like to add that I am using a Dynatrace Managed Env and had to add the flag "disableSSLVerification". 
 
Can someone please help asap! Thank you!
5 REPLIES 5

DavidMass
Dynatrace Mentor
Dynatrace Mentor

Hi @trevordconsult , 

Can you please try updating to Python 3.10 from 3.8 as that is what is currently used by the Extensions 2.0 framework. 

I got passed that issue and now I am getting this issue? I still cannot seem to init the workspace. 

 

2024-04-27T15:30:33.867Z [INFO][utils.conditionCheckers.checkDtSdkPresent] Is dt-sdk available? false
2024-04-27T15:30:54.537Z [ERROR][utils.subprocesses.runCommand] {
  "error": [
    "'dt-sdk' is not recognized as an internal or external command,",
    "operable program or batch file.",
    ""
  ],
 
Is there a separate command to install dt-sdk? Would this mater if I am running python version 3.11?

Please use Python 3.10 and then install the SDK in your global Python environment. See the docs here to install the SDK via pip : https://dynatrace-extensions.github.io/dt-extensions-python-sdk/#installation 

 

@DavidMass  I see the same issue when using the vscode extension to initialize the project , I have python version 3.10.5 and pip version 23.3.2

Hi @subashsagi41 ,

My apologies for the delay in responding. Are you still experiencing this issue?

To be sure, you've installed the SDK first? 

pip install dt-extensions-sdk[cli]

Can you run 

 dt-sdk --help

manually and it works? 
Are you using python in a venv or in the "global" install?

Featured Posts