1

I am looking for a way to debug remote python script without any set up like in the answer here

I set remote interpreter, set up a debug configuration, click a debug button and got error Event not found:

ssh://myuser@my_ip:my_port/usr/local/bin/python -u /myuser/.pycharm_helpers/pydev/pydevd.py --multiproc --qt-support --client '0.0.0.0' --port 46994 --file /opt/my_work_dir/my_script.py
/: Event not found.

enter image description here

Seems like pyCharm takes care about all debug setting --multiproc --qt-support --client '0.0.0.0' --port 46994 but I have the wrong configuration.

Is there a way how to debug python script without putting pydevd.settrace('host', port=21000, stdoutToServer=True, stderrToServer=True) and other actions?

Community
  • 1
  • 1
comalex3
  • 2,497
  • 4
  • 26
  • 47

4 Answers4

1

I was able to fix this problem by reinstalling PyCharm. (# 1 and 5 are optional)

  1. Export minimum settings you want to restore such as Keymap (File > Export Settings)
  2. Uninstall your current PyCharm
  3. Install new PyCharm
  4. Launch new PyCharm and don't import your pre-existing setting at the first start up
  5. Import your settings from the old PyCharm (File > Import Settings)

I guess this happens when some environment related settings are messed up. Notice that you need to remember your settings for the remote interpreter as it will be gone when reinstalling.

0

I use vagrant quite often with pycharm and debugging has always worked great for me as long as i setup the interpreter to the one inside the vagrant box running.

If you go to settings->project->project interpreter and then setup a connection to your remote interpreter it will usually install the pycharm-debug.egg etc and you can debug run your project against this interpreter and set breakpoints in pycharm and it will break on those.

Here is their docs on setting this up https://www.jetbrains.com/help/pycharm/2016.1/configuring-remote-python-interpreters.html

davidejones
  • 1,869
  • 1
  • 16
  • 18
0

I set up remote debugging as described under the section

Remote debug with a remote interpreter

(not the Server!!) and it works very well.

Here the link: https://www.jetbrains.com/help/pycharm/2016.1/remote-debugging.html

You just have to set up the remote interpreter (I used ssh) and then set up your run configurations. Let me know if you need further help.

Here is my run configuration in PyCharm: enter image description here

RichArt
  • 1,534
  • 18
  • 35
  • ya, that is the issue. I have set up a remote interpreter and when I run debug configuration I got Event not found. – comalex3 Nov 15 '16 at 10:00
  • you are trying to debug some python code on your remote server, right? So, does my answer help you? – RichArt Nov 15 '16 at 12:11
  • no, your answer didn't help, because in my question you can see: I use remove python interpreter(it means ssh) – comalex3 Nov 16 '16 at 11:00
  • Well, I don't know what exactly remove python interpreter means. I cannot see this option in my PyCharm. Why are you doing it that way? Why not SSH? I updated my answer with my run config. May be this helps? – RichArt Nov 16 '16 at 14:27
0

It might be the same issue as this. Use bash as your login shell if you use another one like csh or tcsh.

Sunny
  • 11
  • 2