Search code examples
intellij-ideapycharm

Why did Pycharm ask me to set up a sync folder every time when I add a remote interpreter?


Every time I tried to config a remote interpreter, Pycharm asked me to set a sync folder. In my routine, I usually have the Cannot find declaration to go to error which can not be solved by invalidating caches. So I have to config the interpreter again. And these caused the redundant folders in my remote machine. And another situation is that I want to create other projects with the same interpreter. Where I have to config the folder mapping for each project to make the interpreter valid.

I do not understand this way. In my opinion, the sync folders should correspond to my local project. And the interpreter should be independent of the projects.


Solution

  • Every time I tried to config a remote interpreter, Pycharm asked me to set a sync folder.

    To be able to execute a script on the remote machine, it is necessary to make sure it exists on it. This is by design, but if you already have a project folder deployed, you can change the suggested paths to needed ones during the interpreter configuration.

    See step 7. https://www.jetbrains.com/help/pycharm/configuring-remote-interpreters-via-ssh.html#ssh

    And another situation is that I want to create other projects with the same interpreter. Where I have to config the folder mapping for each project to make the interpreter valid.

    Unfortunately, this setup does not work, please vote for https://youtrack.jetbrains.com/issue/PY-40680/Allow-reusing-a-single-remote-interpreter-in-multiple-project to increase its priority.