Opening remote project in PyCharm

kbrk picture kbrk · Jul 30, 2015 · Viewed 23.3k times · Source

I'm working on a project that is located in a remote server. Do I able to open it in PyCharm from my local machine ? I couldn't find the way.

Answer

Skusku picture Skusku · Dec 3, 2017

The way I access the projects on my raspberry pi using PyCharm is the following (This expects you to be using PyCharm Pro, supporting SSH connections):

  1. Mount the home folder on my local machine ( I use SFTP Drive on windows, under Linux use sshfs).
  2. Open the project from the mounted drive in PyCharm
  3. Go to Settings -> Project -> Project Interpreter and select the gear next to the Project Interpreter drop down. From there pick "Add Remote".
  4. Configure the remote interpreter you want to use.

If the PyCharm project was already created on the server, I guess your run configuration should be in order and running it should work out of the box.

If you created the PyCharm project on your local machine:

  • If you have no run configuration yet, go to the file you want to run and do right-click -> Run yourfilename.py or simply hit Shift-F10
  • The remote interpreter will complain about non existent files. Go to the dropdown in the top right corner, click it and select 'Edit Configurations'
  • Change the script path and working directory to the actual remote directories. Remember, this is what your interpreter sees, and your interpreter is on your remote machine.

Hope this helps!