PyCharm 2019.1.3 (Professional Edition) problem with remote dubugging of an application

已完成

Hello,

I used the following the following walk through https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#debug-app for "Creating a deployment configuration for a remote interpreter".

It works for debugging of a script in one file, but fails to import variables defined in the other project's files.

It makes sense to me because even though I set a mapping of the local repository to an external environment repository when setting up the ssh interpreter, yet I still see local script path and working directory in "Run > Debug Configurations".

So, my question is: is it possible to debug an entire application containing multiple files using ssh interpreter? And if yes, then how.

Thank you!

0

Hi,

The first thing you need to know is that PyCharm works around the idea that local files go first and remote files go second, meaning that you develop locally and then deploy your project files to the remote host.

Having your files locally is necessary for performance reasons (code completion, inspections, etc.).

The easiest way to set up remote development is to configure SSH-based interpreter and make sure that you checked the following option:

In such case, PyCharm will create the needed Deployment configuration automatically and upload your files to the remote host. You can then work on your files locally and run them on the remote host (PyCharm will automatically upload new and changed files).
Here is a tutorial on how to configure it https://www.jetbrains.com/help/pycharm/configuring-remote-interpreters-via-ssh.html

0

Hi Sergey,

 

Thank you for your reply.

I followed the tutorial that you specified and made sure that I checked the box regarding the automatic upload. However, I experienced challenges with having to manually upload files to server every time I want to sync local and remote. I described my situation here:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/360004217979-PyCharm-2019-1-3-Professional-Edition-problem-with-sync-when-debugging-remotely-using-ssh-interpreter

My problem right now is that even though local and remote environments are synced, debugging doesn't work when it involves more than one file, i.e. when I import one source file from another one.

0

So the option Upload changed files automatically to the default server is set to Always?
Could you please share a screenshot showing the problem and another one showing the import statement and location of both files?

0

I set Upload changed files automatically to the default server to Always when setting up the environment. But I don't know how to confirm it now with a screenshot. Tools > Deployment > Configuration tab doesn't seem to have the appropriate box. Please let me know if there is a way.

I'll create a toy project with import and will share it here tomorrow. Thanks!

 

0

It is under Settings/Preferences | Build, Execution, Deployment | Deployment | Options

You need to set it to Always.

>I'll create a toy project with import and will share it here tomorrow.

You can also upload it to our service https://uploads.services.jetbrains.com/ zipped, just let me know the name of the file so I can find it.

0

Sergey, I've created a new toy project and everything seems to work well in there.

Can you please keep the conversation open for a week?

I'll try to re-create my other (big) project with a remote interpreter and report here on the results.

Thanks!

0

Sergey, the problem was that when I was setting "Upload changed files automatically to the default server" I didn't set the default deployment server.

Everything works now -- please close the ticket.

Thanks for your help!

0

请先登录再写评论。