[英]How to solve PyCharm error with docker "can't open file 'path/to/file.py': [Errno 2] No such file or directory"?
There is a server in the network, where our docker containers images are.网络中有一个服务器,我们的 docker 容器镜像就在那里。 I have build the image in the server, then on PyCharm I tried to follow the steps here , I could select the Docker settings, it shows the image that I have just created, let's say a image named 'teste1', I can see that all my libs were installed.
我已经在服务器中构建了图像,然后在 PyCharm 上我尝试按照此处的步骤进行操作,我可以选择 Docker 设置,它显示我刚刚创建的图像,假设一个名为“teste1”的图像,我可以看到我所有的库都已安装。
Until here everything is OK.直到这里一切正常。 But when I click to run any script from my project it shows the message:
但是,当我单击以从我的项目中运行任何脚本时,它会显示以下消息:
FileNotFoundError: [Errno 2] No such file or directory: '/opt/project/zoro/run_pipeline_and_persist.py'.
FileNotFoundError: [Errno 2] 没有这样的文件或目录:“/opt/project/zoro/run_pipeline_and_persist.py”。
I have read an answer here about it, but didn't worked.我在这里阅读了一个关于它的答案,但没有奏效。
PyCharm version 2019.3 PyCharm 2019.3 版本
This setup (container on the remote machine) is not "natively" supported by PyCharm at the moment, unfortunately.不幸的是,PyCharm 目前不“本地”支持此设置(远程机器上的容器)。
In the meantime, you can configure it to work with some extra clicks, please see the instruction in PyCharms' bug tracker (and vote for the ticket) https://youtrack.jetbrains.com/issue/PY-33489同时,您可以将其配置为使用一些额外的点击,请参阅 PyCharms 的错误跟踪器中的说明(并投票给票) https://youtrack.jetbrains.com/issue/PY-33489
Basically you need to configure the deployment configuration alongside remote Docker interpreter and tweak path mappings.基本上,您需要在远程 Docker 解释器旁边配置部署配置并调整路径映射。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.