PyCharm 2017: Remote debugging using remote interpreter doesn't work
I set up a remote interpreter and verified that I can run a script using the remote interpreter. Console output in the Run window looks like this:
ssh://freddy@192.168.178.60:22/usr/bin/python -u /home/freddy/workspace/tensorflow/models/inception/inception/imagenet_train.py --num_gpus=2 --batch_size=64 --num_sub_batches_per_batch=2 --train_dir=/tmp/imagenet_train --data_dir=/media/data/imagenet
The script 'imagenet_train.py' works fine.
However when I start the remote interpreter in debug mode, nothing happens:
1. I do not get a debug window
2. The debug icon remains gray after I clicked it to start debugging
There is no other output what so ever.
The only clue I have is (and this already shows at start up of Pycharm) a error message in the 'Python console' :
Error:Failed to add remote port forwarding
Any input to how to get my remote debugging going is appreciated.
Please sign in to leave a comment.
Ok, so I found my solution. The error in my Python console let me to it ('Error:Failed to add remote port forwarding').
On my Ubuntu server I had to set 'AllowTcpForwarding yes' in the ssh config file (/etc/ssh/sshd_config) and restart the SSH daemon.
Would be good if PyCharm would give an error when I start debugging that something is wrong, I didn't get any output at all.
I don't know what's going on, but when I have this problem, I simply restart `(File -> Invalidate Caches / Restart ...)` PyCharm and it was fixed :)
Restarting always helps :)
@huangbiubiu
Have you tried setting AllowTcpForwarding to yes as mentioned above?
PyCharm 2019.1.4 (Professional Edition)
Build #PY-191.8026.44, built on July 30, 2019
JRE: 11.0.2+9-b159.64 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.4.0-37-generic
I am catch the error "Failed to add remote port forwarding" yesterday on Django server with Remote Deployment SFTP Interpreter after few years of well work. PyCharm restart helps.