0

I am using PyCharm in ubuntu. I have access to an external server to which I connect my PC via ssh.

How can I edit codes using PyCharm on my PC but run the codes within PyCharm (by hitting Ctrl+F5 to be clear, so without the server's terminal) using the server's python (and computing power)? Is there any other IDE capable of doing it?

Also, if inputs are needed and outputs are created, can they be stored locally on my PC?

Thanks!

Mohideen bin Mohammed
  • 18,813
  • 10
  • 112
  • 118
leo_damico
  • 13
  • 4

1 Answers1

0

Yeah, but you need Professional version of PyCharm.

First, you need to establish an interpreter:

  • Go to File -> Settings -> Project -> Project Interpreter -> wheel button -> Add -> SSH Interpreter.
  • Configure host, port, username and press Next.
  • Configure your authentication option (password or key pair).
  • Press Next and configure your python environment (by default: /usr/bin/python). You can put here your Python executable of your virtualenv.

Second, configure Deployment:

  • Go to File -> Settings -> Build, Execution, Deployment -> Deployment.
  • Add a new one by hitting the + green button.
  • In Type, choose SFTP.
  • Configure host, port, username and authentication in Connection.
  • In Mappings, you need to configure where the project is on your local and remote hosts.

Then, in Tools -> Deployment, check "Automatic Upload (always)".

Now, when you hit Ctrl + S to save, or run your project, it automatically saves in your local and remote hosts, and runs in the remote server.

If you need to access to the files in the remote host, you can add an FTP view in Tools -> Deployment -> Browse Remote Host.

cxw
  • 16,685
  • 2
  • 45
  • 81