I have a compute engine instance running on Google cloud platform.
I would like to use the Python interpreter of the compute engine as a remote interpreter with Pycharm. This means that I would be using Pycharm on my local machine and running computations remotely.
Any clue on how to achieve this?
The following requires, as James Hirschhorn pointed out, the Professional verison of PyCharm.
gcloud compute config-ssh
to automatically add the VMs of your project to your ~/.ssh/config
or manually add the public IP of your VM to it. If you skipped step 1. then you have to run gcloud compute config-ssh
every time you re-start the remote VM, because it always gets a new IP assigned. The ~/.ssh/config
gets populated with many entries in the following format:
Host the-vm-host-name # use this in PyCharm's Host field
HostName 123.456.789.00 # the VM's IP address
Host
name of the remote you want to connect in your Deployment configuration in PyCharmpython
of your Python installation.My understanding is that you need the Pycharm Ultimate Edition to support remote servers. If you have Ultimate, then you can follow these instructions.
It's fairly easy to accomplish. You need:
PyCharm Pro
Create and format SSH keys
Config your Compute Engine instance with the SSH keys
Configure PyCharm
You can follow this tutorial that I wrote.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With