choose where to run interpreter over host with multiple deployment paths.

已回答

hello,

i have a project that is deployed on server host A.

but, i created 2 deployment paths on the same server for a reason.

so, i can easily choose which path to synch using the pycharm deployment tool.

so far, pycharm offers nice tool to manage to the deployment.

my issue is with the interpreter.

i configured an interpreter to be on the same host.

the interpreter pooled the 2 deployments paths from the deployment config which is fine.

the deployment paths are orders in this last list as path1, and path2.

the issue is: the interpreter keeps running the code in path1 despite that i have changed the synch deployment to path2.

i assumed that when i change the current deployment path, the interpreter will run in the code in that path or at least give the option to choose where it should run. it is not the case.

the interpreter seems to always run the code in the first path in the deployment  list.

is there a way to to tell the interpreter to run the code in the current deployment path?

the interpreter is ssh based.

also, it seems that the interpreter runs always in the deployment path that was indicated when the interpreter was first created.

let me know if you need more info.

thanks

0

Hi,

Unfortunately, there is no easy way to switch between deployment paths for your interpreter as it is always uses the deployment configuration that you selected during the interpreter configuration. You can switch the deployment configuration manually by editing the interpreter in Preferences | Project | Python Interpreter -> click the cogwheel -> Show All...

Another option is to configure a second SSH interpreter using another deployment configuration and then just switch between these two interpreters. Note, there is a known issue that will be fixed in 2021.2 https://youtrack.jetbrains.com/issue/PY-33981

0

hi,

thank you for confirming the issue.

i thought i am missing something.

right now, i am using the second option. i created a second ssh interpreter that is configured toward the second deployment path. it is cumbersome, but it works.

hopefully, this issue will be considered in future releases.

the issue in https://youtrack.jetbrains.com/issue/PY seems different. and it looks like it makes sens that the deployment should be B at the end.

just a suggestion, i think it is better

1. that the current deployment that must control where the interpreter should be run. if there are many deployment paths, the user needs to define the current deployment path.

2. when creating an interpreter, it shouldn't be hardly linked to a deployment path. the interpreter should autonomous and should run automatically on the current deployment path.

of course, an interpreter will be able to use the current deployment path if they are on the same host.

following these 2 rules, both issues (mine, and the other in the link), become trivial.

thanks

0

hi,

i am trying to create 2 identical ssh interpreters (different only in name) to be able to deploy to different locations.

i am getting an error window that prevents that saying 'there is already the same interpreter'.

creating 2 interpreters where one is ssh and second is deployment configuration is fine even if they point to the same exact interpreter. you can choose the type ssh or deployment configuration in the window: configure remote interpreter.

any idea how to fix this and allow creating 2 identical ssh interpreters? thanks

info:

PyCharm 2021.2.2 (Professional Edition)
Build #PY-212.5284.44, built on September 14, 2021For educational use only.
Runtime version: 11.0.12+7-b1504.28 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 4.17.4-041704-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 1958M
Cores: 12
Non-Bundled Plugins: atom-one (1.4), ClearCachePlugin (1.1), intellij-clock (2.0.0)
Current Desktop: ubuntu-communitheme:ubuntu:GNOME

 

0

seriously, i cant create 2 ssh interpreters that point to the same python...

0

> 'there is already the same interpreter'.

 

Could you please attach a screenshot of the error? 

There should not be any issues with adding identical interpreters to the configuration. May you provide a couple of screenshot examples as well?  

0

to reproduce:

1- create an ssh interpreter.

2- create identical ssh interpreter. pycharm will force-use a deployment configuration (see screenshot). if you try to set it to ssh, and save, it will throw the error.

thanks

 

 

 

 

 

 

0

Could you tell me if it will make any difference if you start the IDE with default settings?

See how to do it here https://www.jetbrains.com/help/pycharm/configuring-project-and-ide-settings.html#restore-defaults , the current settings will be backed up you may restore them later. 

0

i just tried with ide default settings, and i get the exact same error.

it seems like, you can create only one for ssh and other for deployment configuration (in the last figure in my previous comment). cant create both ssh type.

pycharm 2021.2.3 is out. i am going to upgrade to test with my previous configuration.

thanks

0

now, i cant select the previous configuration folder `.config/JetBrains/PyCharm2021.2-backup` as described in

https://www.jetbrains.com/help/pycharm/configuring-project-and-ide-settings.html#restore-defaults

i can select `.config/JetBrains/PyCharm2021.2` `.config/JetBrains/PyCharm2021.1` but not `.config/JetBrains/PyCharm2021.2-backup`

i have to select inside the the backup folder.

when saving my config,. it said that the name is '2021-10-21-18-09'. but this fold does not exist. i found '2021-10-21-18-10'.

0

the same interpreter problem is still in pycharm 2021.2.3.

thanks

0

请先登录再写评论。