2

I set up my Aptana Studio 3 / PyDev debugger according to the instructions and even got to the point where everything worked, including breakpoints and auto-reload. Loved it. Now, as of an update last Saturday, the debugger doesn't work any more. I noticed that the

Aptana Studio 3/plugins/org.python.pydev.debug_x.x/pysrc

folder has gone missing. I found another pysrc folder in

Aptana Studio 3/plugins/org.python.pydev_x.x

which seems to contain the required pydevd module, together with the patch_django_autoreload() function and all. But if I put it on the Python path, I just get an ugly stack trace, ending in

OSError: [Errno 2] No such file or directory

Any ideas what's gone wrong here? Using Aptana Studio 3.2.0.201206251729, Django 1.3.1, Python 2.7.1 on OS X 10.7.4.

EDIT The full traceback:

Executing process on new console: /usr/bin/python /Users/timo/Documents/aptana-studio-3-workspace/ssm/ssd/manage.py runserver 0.0.0.0:8000
Warning: to actually kill the created console, the parent process (in Eclipse console) must be killed first.
Traceback (most recent call last):
  File "/Users/timo/Documents/aptana-studio-3-workspace/ssm/ssd/manage.py", line 22, in <module>
    execute_manager(settings)
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 67, in handle
    self.run(*args, **options)
  File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 76, in run
    autoreload.main(self.inner_run, args, options)
  File "/Applications/Aptana Studio 3/plugins/org.python.pydev_2.6.0.2012062121/pysrc/pydevd.py", line 1175, in main
    return original_main(main_func, args, kwargs)
  File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 138, in main
    reloader(main_func, args, kwargs)
  File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 116, in python_reloader
    sys.exit(restart_with_reloader())
  File "/Applications/Aptana Studio 3/plugins/org.python.pydev_2.6.0.2012062121/pysrc/pydevd.py", line 1212, in restart_with_reloader
    popen = subprocess.Popen(args, env=new_environ)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

EDIT 2 Some more debug info, as requested:

args: ['xterm', '-e', '/usr/bin/python', '/Users/timo/Documents/aptana-studio-3-workspace/ssm/ssd/manage.py', 'runserver', '0.0.0.0:8000']

new_environ: {'PYTHONIOENCODING': 'UTF-8', 'RUN_MAIN': 'true', 'VERSIONER_PYTHON_PREFER_32_BIT': 'no', 'LOGNAME': 'timo', 'USER': 'timo', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/Users/timo', 'DISPLAY': '/tmp/launch-Hsa1eC/org.x:0', 'SHELL': '/bin/bash', 'TZ': 'Europe/Vienna', 'VERSIONER_PYTHON_VERSION': '2.7', 'SECURITYSESSIONID': '186a5', 'GL_ENABLE_DEBUG_ATTACH': 'YES', 'PYDEV_CONSOLE_ENCODING': 'UTF-8', 'com.apple.java.jvmTask': 'JNI', 'PYTHONPATH': '/Applications/Aptana Studio 3/plugins/org.python.pydev_2.6.0.2012062121/pysrc/pydev_sitecustomize:/Users/timo/Documents/aptana-studio-3-workspace/ssm/ssd:/Applications/Aptana Studio 3/plugins/org.python.pydev_2.6.0.2012062121/pysrc:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages:/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload:/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC:/Library/Python/2.7/site-packages:/Applications/Aptana Studio 3/plugins/org.python.pydev.debug_2.4.0.2012020116/pysrc', 'SSH_AUTH_SOCK': '/tmp/launch-ILkkCc/Listeners', 'CELERY_LOADER': 'djcelery.loaders.DjangoLoader', 'Apple_PubSub_Socket_Render': '/tmp/launch-GuOmAI/Render', 'TMPDIR': '/var/folders/yw/7q8d2tzj70q1yqwwqhgkqsw00000gn/T/', 'APP_ICON_844': '../Resources/aptana.icns', 'PYDEV_COMPLETER_PYTHONPATH': '/Applications/Aptana Studio 3/plugins/org.python.pydev_2.6.0.2012062121/pysrc', '__CF_USER_TEXT_ENCODING': '0x1F5:0:0', 'Apple_Ubiquity_Message': '/tmp/launch-lxY2Pu/Apple_Ubiquity_Message', 'DJANGO_SETTINGS_MODULE': 'ssd.settings', 'COMMAND_MODE': 'unix2003'}

There's two things to note here. 1) I tried to check whether everything on the PYTHONPATH actually existed. This was mostly the case, except for /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip and /Applications/Aptana Studio 3/plugins/org.python.pydev.debug_2.4.0.2012020116/pysrc, which makes me wonder whether I just have to get Aptana to rescan the Python directories. 2) The Aptana application path contains spaces (by default). I've seen some rare cases where libraries of any kind still choke on that.

Timo
  • 151
  • 1
  • 1
  • 8

3 Answers3

1

The org.python.pydev.debug/pysrc is really removed (and the correct one is really org.python.pydev/pysrc as you found out)... Will update the homepage to reflect that :)

So, with this it should be working... Now, as for your error, please post the complete error log (with just that part, it's hard to know what may be happening -- tested it here with that path and it does work properly).

Fabio Zadrozny
  • 24,814
  • 4
  • 66
  • 78
  • Added the full traceback, see above. – Timo Jul 03 '12 at 14:59
  • Can you edit: pydevd.py, at line 1212, (method restart_with_reloader) add a try..except there and print the 'args' and 'new_environ'? – Fabio Zadrozny Jul 04 '12 at 15:29
  • Okay, some more debug info above. – Timo Jul 05 '12 at 09:17
  • ...and I just tried to have Aptana rescan all the directories by removing and adding the python interpreter again. No luck. – Timo Jul 05 '12 at 09:32
  • Can you try executing: "xterm -e /usr/bin/python /Users/timo/Documents/aptana-studio-3-workspace/ssm/ssd/manage.py runserver 0.0.0.0:8000" from the command-line to see the results? My guess is that for some reason it cannot find 'xterm', but executing from the command-line may give more insight... Also, before executing it'd be nice if you could set the environment variables to be the same as the 'new_environ'... – Fabio Zadrozny Jul 05 '12 at 10:50
  • Sure. I made a shell script out of it and you were right: It couldn't find xterm. Mac OS X seems to put the xterm binary into `/usr/X11/bin` which is not on the PATH. Just to try it out, I added `new_environ["PATH"] = "/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin"` to pydevd.py, and everything worked as expected, including breakpoints. Not a fix yet, but I guess this can be added correctly somehow :) – Timo Jul 05 '12 at 19:03
  • Just add it to your PATH then. See: http://stackoverflow.com/questions/7501678/set-environment-variables-on-mac-os-x-lion – Fabio Zadrozny Jul 05 '12 at 22:03
  • Thanks for the link. Actually, the issue with the PATH is a bit weird because generally, xterm _is_ on the path and there's no problem starting it from the OS X terminal. Somehow, though, when pydevd.py copies the environment on line 1195, PATH seems to lack lots of entries. No idea why, so I'll leave my fix in there for the moment. – Timo Jul 06 '12 at 09:26
0

not sure if related but I upgraded eclipse from 3.6 to 4.2 and Aptana from 2 to 3 with pydev Now my debugger is not working. After upgrading eclipse, aptana, pydev, Debugger not working

Community
  • 1
  • 1
Brian
  • 127
  • 2
  • 10
  • I don't think questions/11388503 is related but Fabio Zadrozny found a solution to this upgrade issue: try..except on "import pydevd_console", Thank you Fabio – Brian Jul 09 '12 at 20:18
0

I had this issue too and just upgraded to PyDev 3.4.1, which fixed things for me. Read through http://pydev.org/manual_adv_debug_console.html if you keep having issues.

Sven
  • 985
  • 1
  • 11
  • 27