gpt4 book ai didi

python - 使用现有的容器 python 解释器作为 PyCharm 解释器

转载 作者:行者123 更新时间:2023-12-05 04:51:41 24 4
gpt4 key购买 nike

我安装了最新的 PyCharm。我有一个 docker 容器,我想使用它的 python 解释器作为我的项目解释器。请注意,我不希望 PyCharm 每次运行脚本时都从图像创建新容器。这样做的步骤是什么?如果我使用容器解释器,PyCharm 是否支持容器解释器中安装的包的代码完成?

最佳答案

我已经在 https://youtrack.jetbrains.com/issue/PY-53854 上提交了功能请求因为这根本不是 PyCharm 中的功能。

我考虑过的一个临时解决方案是让 PyC​​harm 使用 Dockerfile 中的 python:docker exec -it container-name python,但不幸的是 PyCharm 不允许我将“命令”设置为IDE 的 python 解释器。它确实允许您为特定的运行/调试配置设置命令 - 所以如果您不想与编辑器集成(例如导入建议),您可以在运行的容器中使用 python 解释器。


User: Is there a technical reason as to why PyCharm cannot use an interpreter inside an already running container? Or could I expect it to be part of a future release? It would be a very nice feature to have

Jetbrains team: I am not aware of any technical reasons. I couldn't find any feature request for it.

Please feel free to submit a feature request about it to our issue tracker using the link https://youtrack.jetbrains.com/issues/PY and let us know if you need any help.

关于python - 使用现有的容器 python 解释器作为 PyCharm 解释器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66806314/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com