PyCharm debugging with remote instance not working

Answered

 Hello,

I have a problem, that seems common, but after several days trying to correct it according to many different options, I couldn't find any solution. I am working with PyCharm on mac on a remote instance on Ubuntu.

I can (most of the time) run my program easily, without any problem. But when I am trying to use the debugging, I have a task telling me  'Checking Remote Helpers', which never ends, till I got 'Error running 'project': Python helpers are not copied yet to the remote host. Please wait until remote interpreter initialization finishes.' on the Event log. I said 'most of the time' because it sometimes have the same issue when I'm running without debug.

I found other posts about similar issues, telling that it might help to delete the '.pycharm_helpers' on the remote instance, but nothing changed for me ...

Do you have any idea on settings or any things that I could do to fix that ?

 

On a different topic, I also have troubles to print the plots from matplotlib in PyCharm. I'm using plt.show(), but sometimes (rarely) it print, sometimes it don't ... I was wondering if I needed to set specific settings (I tried to add an environment variable 'DISPLAY' either with 'localhost:10:0' or 'True' but nothing changes!), or if it was only working with the debugging mode ?

 

In advance, thank you for your help !

15 comments

Hi Maxime,

Please upload your idea.log (Help | Show Log in...) after reproducing the problem and a screenshot showing the problem zipped to https://uploads.services.jetbrains.com/ and let me know the name of the zip file.

0

Here it is : 'Archive_PyCharm_MaxB.zip'

0

I have filed an issue about it https://youtrack.jetbrains.com/issue/PY-32385, please follow it for updates and direct communication with developer. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.

Logs are attached to the issue with corresponding privacy settings (visible to JetBrains only).

0

Alright, thank you !

Do you have any ideas about the plot issue ?

0

Sorry, I missed it somehow..

Do you have Preferences | Tools | Python Scientific | Show plots in toolwindow option enabled?

Some code sample would also help to investigate.

0

Yes ! And it sometimes plot without changing anything !

Any kind of plot, for example :

>>> import matplotlib.pyplot as plt
>>> plt.plot([1,2,1,3,4,2])
[<matplotlib.lines.Line2D at 0x7fead6c6ff28>]
>>> plt.show()

I tried several things such as change the matplotlib configuration to other GUI backends : TkAgg, WX, QTAgg, QT4Agg, QT5Agg ... nothing changed.

0

Could you please specify what interpreter do you use (Anaconda/pure Python)?

 

0

Pure python (version 3.5.6)

0

Hm, that's odd.

I couldn't reproduce it.

I know that it is not happening constantly, but could you please try to reproduce the problem and then attach a screenshot showing it and upload a new idea.log file?

 

0

 Here it is : idea.log_plot_MaxB.zip
(I didn't add any screenshot as nothing is happening ... no error message, no display, nothing !)

0

Could you please try it in the latest EAP build and see if problem remains? https://www.jetbrains.com/pycharm/nextversion/

0

I tried it and there is no changes ...

In the log, I got that last entry :

2018-10-25 10:12:36,504 [ 20406] INFO - ellij.ssh.SshConnectionService - Executing SSH command: cd /home/maxim/timely-suggestions; env "PYCHARM_MATPLOTLIB_INTERACTIVE"="true" "PYCHARM_MATPLOTLIB_PORT"="53820" "PYCHARM_HOSTED"="1" "DISPLAY"="localhost:55555" "PYTHONUNBUFFERED"="1" "PYTHONPATH"="/home/maxim/.pycharm_helpers/pycharm_matplotlib_backend:/home/maxim/timely-suggestions:/home/maxim/.pycharm_helpers/pydev" "PYCHARM_MATPLOTLIB_INDEX"="0" "JETBRAINS_REMOTE_RUN"="1" "PYDEVD_LOAD_VALUES_ASYNC"="True" "PYTHONDONTWRITEBYTECODE"="1" "PYTHONIOENCODING"="UTF-8" "IPYTHONENABLE"="True" ...

The thing is that the PYCHARM_MATPLOTLIB_PORT value can't stop changing ... Is that why I don't reach the Scientific view (that might be waiting for the plot to come to the DISPLAY port) ?

I found that : https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000609664-PyCharm-Remote-Python-Interpreter-keeps-changing-the-port-it-uses- I was wondering if it might be the same issue ? (It is not working when I'm using the debugger, but should I configure the remote debugger myself ? Should it change something ?)

0

Thanks for the update.

The port is constantly changing indeed.

So please vote the feature request https://youtrack.jetbrains.com/issue/PY-21325 and follow if for future updates. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.

0

I have this problem with remote helpers as well. Can't get remote helpers to upload at all. Any updates on the solution to this issue?

0

Hi Kaho,

Can you please try the workaround mentioned in the comments of the following ticket?:

https://youtrack.jetbrains.com/issue/PY-30124

The one which says to untar the helpers manually. If this will help, then you're also affected my this issue which should be fixed in one of the upcoming releases.

0

Please sign in to leave a comment.