PyCharm Remote Debug Server Error

Answered

Hello,

I am attempting to use the remote debug server to debug a script that I am running on my local machine with the MAMP application. Within run/debug configurations, I added the proper credentials, and I am using the pydev directory. I added pycharm-debug.egg to my pythonpath with the command: $ PYTHONPATH=$PYTHONPATH:/Applications/PyCharm.app/Contents/debug-eggs. I have import pydevd and pydevd.settrace('localhost', port=21000, stdoutToServer=True, stderrToServer=True) in my local script. This script is copied to my remote script in a folder within the MAMP application, which runs perfectly fine. My local script in PyCharm and my "remote" script in the MAMP folder (still on my local machine) are identical.

When I select debug, the response I get is:

Starting debug server at port 21000
Use the following code to connect to the debugger:
import pydevd
pydevd.settrace('locahost', port=21000, stdoutToServer=True, stderrToServer=True)
Waiting for process connection…

Pycharm continues to wait for the process connection until I stop the server. Is this the correct way to use the settrace statement, or do I have to use the public IP of my local machine to connect to the script in MAMP? Should I add something to the "Path mappings" section of the Run/Debug Configurations window?

Thank you!

0
2 comments

Hi! From your description I didn't get the order of your steps. The correct order is:
1) Start Remote Debug Server PyCharm (After that you'll get this message with port number)
2) After that you should copy lines: 
import pydevd
pydevd.settrace('locahost', port=21000, stdoutToServer=True, stderrToServer=True)
And put them inside script on your remote machine. Don't forget to change host name if needed.
3) After that you should run the script on the remote machine and after the execution settrace() function you will be able to debug your script.

Do you execute the steps in this order?

0
Avatar
Permanently deleted user

It worked! I was not executing the steps in the right order. THANK YOU! - Avery

 

0

Please sign in to leave a comment.