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

VS Code - oneagent is not working locally


Hi, I am using VS Code as my IDE, using Python 3.8.6, I have oneagent-sdk  I installed this using pip that goes against our Nexus repository, it is the only version I can install.  I have followed all of the instructions on the Git but I get an error if I run the verify test - python -c "import oneagent; print(oneagent.initialize())" - the error is:

InitResult(status=InitResult.STATUS_INIT_ERROR, error=SDKError(2952658951, 'onesdk_initialize_2: Could not load agent.'))

I have tried reinstalling, as stated in the readme, upgrading pip, setup tools, and wheel, deleting the installation and reinstalling, downloading the C version (more about this in a second), and everything else in the documentation.

Following the I set an environment variable - DT_PYSDK_CSDK_PATH to the C installation I got 'Agent version:  /1.6.1' so it almost seemed I had to set an environment variable for oneagent.


If anyone can help me i would greatly appreciate it.  I have been working on this for a few days and I have run out of ideas.  Thanks.


DynaMight Legend
DynaMight Legend

Based on your errors, you have the SDK and it works, but you areare not running the oneagent itself. You need to install OneAgent to your host for the SDK to fully work. So you have actually no issue, you just don't have OneAgent installed and running on your host.

The SDK will stay in your case inactive will not send any data to Dynatrace. OneAgent SDK is just a "bridge" between your app code and OneAgent.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

DynaMight Guru
DynaMight Guru

You probably don't have the OneAgent installed on your system, right? 

It's not really stated in the on Github, but that is required. 


Just install it on your dev machine and you are good to go.

Dynatrace Certified Master - Dynatrace Partner -

Featured Posts