Dynamic Languages (Node.JS, Python, PHP, C/C++, Webserver Agent)

Showing results for 
Search instead for 
Did you mean: 

Python Agent in python 3.6




I can't install the python agent in python 3.6, the appdynamics dependencies are not installed with pip.

I tried installing manually but it doesn't work and with python 3.4 but is not working also.


I have a virtualenv with python3.6

Whe I run pyagent run -c /etc/appdynamics.cfg -- gunicorn app.wsgi:application -w 2 --reload --log-level=debug --timeout 150

it gives me: 

NameError: name 'appdynamics' is not defined

Python Agent in python 3.6
AppDynamics Team



Could you do a ls -lf in the agent installed directory and send us the output, I belive it will be in your <virtual environment>/lib/pythonX.x/site-packages/.

There is a open issue with Python 3.4+, I just want to make sure its not the case.


It couldn't find appdynamics, and you also iterated that you are unable to install. What error are you getting while installing.


Is it possible to run you application in Python 2.7 ?






This is the error when starting the pyagent:


(venv) [ec2-user@ip site-packages]$ pyagent run -c /etc/appdynamics.cfg - gunicorn my_app.wsgi -b unix:///var/app/run/gunicorn.sock -w 5
2017-05-12 02:58:19,704 [WARNING] appdynamics.proxy.watchdog <3161>: Defunct proxy pid (3476) found; starting over
2017-05-12 02:58:19,706 [INFO] appdynamics.proxy.watchdog <3161>: Started watchdog with pid=3161
Traceback (most recent call last):
  File "/var/app/envs/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 429, in get_provider
    module = sys.modules[moduleOrReq]
KeyError: 'appdynamics_bindeps.proxy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/app/envs/venv/bin/pyagent", line 11, in <module>
  File "/var/app/envs/venv/lib/python3.6/site-packages/appdynamics/scripts/pyagent/pyagent.py", line 65, in main
    mod.command(options, args)
  File "/var/app/envs/venv/lib/python3.6/site-packages/appdynamics/scripts/pyagent/commands/run.py", line 159, in command
  File "/var/app/envs/venv/lib/python3.6/site-packages/appdynamics/scripts/pyagent/commands/proxy.py", line 119, in start
    proxy_pid = start_fn(run_proxy_script=run_proxy_script, script_args=args, debug=debug)
  File "/var/app/envs/venv/lib/python3.6/site-packages/appdynamics/scripts/pyagent/commands/proxy.py", line 221, in start_watchdog
    start_proxy(run_proxy_script=run_proxy_script, script_args=script_args, debug=debug, proxy_logger=logger)
  File "/var/app/envs/venv/lib/python3.6/site-packages/appdynamics/scripts/pyagent/commands/proxy.py", line 227, in start_proxy
    run_proxy_script = run_proxy_script or resource_filename('appdynamics_bindeps.proxy', 'runProxy')
  File "/var/app/envs/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1197, in resource_filename
    return get_provider(package_or_requirement).get_resource_filename(
  File "/var/app/envs/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 431, in get_provider
ModuleNotFoundError: No module named 'appdynamics_bindeps'
2017-05-12 02:58:19,884 [ERROR] appdynamics.agent <3159>: Exception in agent startup.
Traceback (most recent call last):
  File "/var/app/envs/venv/lib/python3.6/site-packages/appdynamics/agent/__init__.py", line 133, in import_zmq
ModuleNotFoundError: No module named 'appdynamics_bindeps'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/app/envs/venv/lib/python3.6/site-packages/appdynamics/autoinject/sitecustomize.py", line 20, in <module>
    import appdynamics.agent
  File "/var/app/envs/venv/lib/python3.6/site-packages/appdynamics/agent/__init__.py", line 138, in <module>
  File "/var/app/envs/venv/lib/python3.6/site-packages/appdynamics/agent/__init__.py", line 135, in import_zmq
  File "/var/app/envs/venv/lib/python3.6/site-packages/appdynamics/agent/__init__.py", line 50, in make_virtual_bindeps_package
    src_root = get_bindeps_location()
  File "/var/app/envs/venv/lib/python3.6/site-packages/appdynamics/agent/__init__.py", line 96, in get_bindeps_location
    import appdynamics_bindeps
ModuleNotFoundError: No module named 'appdynamics_bindeps'
Failed to import the site module
Traceback (most recent call last):
  File "/var/app/envs/venv/lib/python3.6/site.py", line 703, in <module>
  File "/var/app/envs/venv/lib/python3.6/site.py", line 694, in main
  File "/var/app/envs/venv/lib/python3.6/site.py", line 548, in execsitecustomize
    import sitecustomize
  File "/var/app/envs/venv/lib/python3.6/site-packages/appdynamics/autoinject/sitecustomize.py", line 27, in <module>
NameError: name 'appdynamics' is not defined


This is the output after running pip install appdynamics:


Collecting appdynamics
  Downloading appdynamics- (218kB)
    100% |████████████████████████████████| 225kB 3.4MB/s 
Installing collected packages: appdynamics
Successfully installed appdynamics-

Notice the dependencies  appdynamics-proxysupport-linux-x64 and appdynamics-bindeps-linux-x64 are not installed. An ls -lf | grep appdynamics shows:




Thank you! 

AppDynamics Team



Sorry you had to face the issue. Its a known issue, and we have resolved it, and the fix will out in next release.


In the mean while, I would request you to try installing the dependencies, directly using.


pip install appdynamics-bindeps-linux-x64 appdynamics-proxysupport-linux-x64


Or is possible use lower version python than 3.4.