Reputation: 949
Can we develop in a Pycharm interface in our computer while using the computational resources and environment in another remote PC?
For example in Jupyter Notebook, we can execute the following command inside the remote PC:
jupyter notebook --ip 135.2.55.205 --port 8888
Which allows us to access the notebook with that ip-address remotely from any other computer and after doing so, the codes we we write remotely in the notebook would use the CPU or GPU of the that remote PC. So when I use the debugging feature of PyCharm or simply run the code, I would like the computation to be carried out in the remote PC similar to using the above Jupyter Notebook with that ip address.
Can we do the same with PyCharm? I know in PyCharm we can for example define a remote virtual-environment, but I guess that would still use our own computational power rather than a remote machine.
A similar approach would probably be if I just do remote-desktop to the remote PC, but that won't be very convenient.
Upvotes: 0
Views: 424
Reputation: 2553
This can be done in PyCharm by configuring file editing and execution remotely over SSH (SFTP for the files, which uses SSH). The first step will allow you to see and edit files on the other (remote) machine. The second step will allow you to run a Python interpreter (and therefore debugging) on that same remote machine.
Here is how to configure editing your code on the remote machine using PyCharm: https://www.jetbrains.com/help/pycharm/creating-a-remote-server-configuration.html
Here is how to configure a remote Python interpreter that will run on the remote machine: https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#
For completeness, two other options outside of PyCharm are to (1) use VS Code and the "remote host" functionality. And (2) run jupyter lab on the remote machine which will give you a file editor and terminal on that machine in addition to notebooks.
Upvotes: 2