Is it possible to use different Python interpreters for Git submodules in PyCharm? - Stack Overflow

I’m working on a project in PyCharm that includes several Git submodules. Each submodule has its own re

I’m working on a project in PyCharm that includes several Git submodules. Each submodule has its own requirements, so I need to use a different Python interpreter

Is there a way to set up PyCharm so that it automatically uses the correct interpreter depending on the submodule I’m working in?

In VS Code, you can handle this by adding each submodule as a separate workspace and assigning a specific interpreter to each. Does PyCharm have anything similar?

I’m working on a project in PyCharm that includes several Git submodules. Each submodule has its own requirements, so I need to use a different Python interpreter

Is there a way to set up PyCharm so that it automatically uses the correct interpreter depending on the submodule I’m working in?

In VS Code, you can handle this by adding each submodule as a separate workspace and assigning a specific interpreter to each. Does PyCharm have anything similar?

Share Improve this question asked Nov 19, 2024 at 13:33 Pryduvys OleksandrPryduvys Oleksandr 794 bronze badges 3
  • 1 In terms of the IntelliJ platform, PyCharm is a single-module IDE, so you only have one module per project and thus only one SDK/interpreter. Most JetBrains IDEs work this way, except for the multi-module IntelliJ IDEA, which does support your use case. – InSync Commented Nov 19, 2024 at 13:40
  • 1 why not create a runner script which sets PATH variable and then execute the python script/module? So effectively I am suggesting to run directly from command line instead of from IDE. Now, you are free to configure as per your requirement – Anubhav Sharma Commented Nov 19, 2024 at 13:45
  • @AnubhavSharma Good idea, but I need dynamic interpreter switching in PyCharm for code analysis and autocomplete. Your solution skips that, which defeats the point of using an IDE. – Pryduvys Oleksandr Commented Nov 19, 2024 at 14:14
Add a comment  | 

1 Answer 1

Reset to default 1

In the Run debug configurations (top corner right) you can specify the "python interpreter" for each run/debug setting as well as env variables, flags, paths, entry points and many other things.

You can use a tool such as poetry to create and manage the different environments, but even that can be managed from the IDE.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745558640a4632971.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信