Path Mappings in Development are overwritten after add a new python Interpreter



I am an deep learning researcher and I use PyCharm to manage many codes on remote servers.

Unlike a developer on web or other type of python projects, I need to open many different projects in a single window with different python interpreter.

So I create many projects and attach them in the same window. Then I configurate the path mapping in development settings for each project (each project have at least one path mapping).

Besides, I use Anaconda to create many different python environments with different packages. For example, I setup many environments for each version of TensorFlow and PyTorch. And each interpreter should be able to be used by different projects.

However, the "add new interpreter" must setup at least one path mapping (project root ---> remote path) and after the configuration, all path mapping I configurated in "development" will be overwrite by this project mapping.

I think the logic behind this is that each interpreter sould be only used by a single project, which is not shareable with other projects. But for machine learning and research purpose, the interpreter should be independ for each project so that different project can use identical interpreter.

And I also think that whether we add new python interpreter, the path mapping in development should not be touched at all.


Comment actions Permalink


Do I correctly understand once you configure another remote interpreter your path mappings in Deployment are automatically changed?

Would it be possible to provide the exact steps for reproducing?

I tried to configure remote interpreters with different settings, but none of them overwrite existing Deployment configurations.

Comment actions Permalink

I have the same issue.

Steps to reproduce:

1) In the "Settings..." of a new project
1a) Create a new deployment configuration to a new server;
(I created a SFTP connection using authentication agent authentication, but I guess it doesn't matter.)
1b) Use some root path other than "/". Like in my case "/disk/user/jschoena".
1c) In the Mappings, define a deployment path, for example project root -> "myproject"
1d) Apply.

2) In the "Settings..." of this project
2a) Add a new project interpreter
2b) SSH Interpreter -> Existing server configuration -> Your config from step 1)
2c) Next.
2d) Notice: You HAVE to specify "Sync folders". 
2e) Notice: There is no trace of the mappings from step 1).
2f) Notice: In the folder chooser, your root path from 1) is ignored.
2g) Create a path mapping from your project root -> "/disk/user/jschoena/myproject2" (other than in 1, for testing purposes)
2h) Finish.
2i) Notice: In the Path mappings preview the path mapping is completely messed up: "<Project root>→/disk/user/jschoena/disk/user/jschoena/myproject2"

3) Goto Deployment settings
3a) Go to your configuration mappings from 1)
3b) Notice: Deployment path apparently hasn't changed (still "myproject")

4) Close Settings with OK. Reopen settings.
4a) Go to your configuration mappings from 1)
4b) Notice: Deployment path has changed to "/disk/user/jschoena/myproject2" - previous setting was overwritten.
4c) Notice: In conjunction with deployment config root path, the effective path mapping is now (as stated in interpreter settings) project root -> "/disk/user/jschoena/disk/user/jschoena/myproject2" - that's bad. The only way to have it correct would have been to NOT use the folder chooser at step 2g, but no way of knowing that.

Comment actions Permalink

So when you create an SSH interpreter, the sync folder path appends to the root path of the deployment, resulting in "/disk/user/jschoena/disk/user/jschoena/myproject2"

In my opinion the root cause is clear and it's easy to avoid this misconfiguration, but I agree it's not perfect from usability POW.

Comment actions Permalink

Hi Andrey, thanks for your quick reply to this, admittedly, a bit aged topic. ;)

Well it's easy to avoid that first problem if you know about it, which could also be temporarily fixed with a simple hint in the dialog what the configured root path is and that it will be appended.

But what you didn't address is the issue of the topic creator, that you HAVE to specify a sync folder, and that it will override the existing one of the deployment config. (compare my steps 1c) with 2g) and 4b) ).

Actually it causes me headaches because I'm trying to write an internal wiki tutorial at our company of how to setup a specific remote interpreter with a) root path other than "/" and b) non-default path mapping; and honestly: It is not possible to configure this thing without re-visiting the same setting pages multiple times because of overridden settings.

So again, here the 3 main points of critique (for step by step see in my previous post):

1) You have to specify path mappings in remote interpreter creation wizard, which is a) ignoring and b) overriding the existing ones in deployment configuration.
2) Root path settings are not accounted for nor hinted to in remote interpreter wizard's sync folders dialog
3) Some settings are not visible in remote interpreter add wizard, like a) option to authenticate with authentication agent and b) pycharm-helpers folder.

In effect, neither through remote interpreter addition wizard nor by visiting deployment settings and then remote interpreter settings can I setup an remote-interpreter with root-path and path mappings without having to visit the same settings/configs multiple times.

My current wiki looks (schematically) like this:
1) Create server config in deployment settings
2) Create remote interpreter in interpreter settings, repeating the path mappings from 1) (but without root path!)
3) Opening the settings again for the just created interpreter to change the default pycharm-helpers path, because it is not asked for in wizard.

Alternatively I could also take this workflow, which is redundant either...
1) Create remote interpreter by wizard (incl. deployment config)
2) Open settings for interpreter to fix pycharm-helpers path
3) Open setting for deployment config again to fix root path and mappings

Both is not cool.

Why not fix the remote interpreter wizard by
a) adding pycharm-helpers path setting to it and
b) provide an option to skip path mappings config to use deployment config's mappings instead?

Then creating an SSH interpreter would really just be one step: using your wizard.


Please sign in to leave a comment.