简体   繁体   English

如何解决 docker 的 PyCharm 错误“无法打开文件 'path/to/file.py': [Errno 2] No such file or directory”?

[英]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.

相关问题 无法打开文件'file.py':[Errno 2] 没有这样的文件或目录 - Can't open file 'file.py': [Errno 2] No such file or directory Python-exec(open('file.py')。read())报告错误-没有此类文件或目录。 'file.py' - Python - exec(open('file.py').read()) reports error - No such file or directory. 'file.py' PyCharm 没有找到 Anaconda Python,给出“无法打开文件 'python.py':[Errno 2] 没有这样的文件或目录?” - PyCharm not finding Anaconda Python, giving “can't open file 'python.py': [Errno 2] No such file or directory?” 在docker容器上运行flask应用程序:错误:python:无法打开文件'//run.py':[Errno 2]没有这样的文件或目录Docker错误 - having on running flask app on docker container : Error: python: can't open file '//run.py': [Errno 2] No such file or directory Docker Error 内部 Docker 容器 - python:无法打开文件 './services/web/manage.py':[Errno 2] 没有这样的文件或目录 - Inside Docker Container - python: can't open file './services/web/manage.py': [Errno 2] No such file or directory 无法打开文件“import.py”:[Errno 2] 没有这样的文件或目录 - can't open file 'import.py' :[Errno 2] No such file or directory 无法打开文件 'main.py': [Errno 2] 没有那个文件或目录 - Can't open file 'main.py': [Errno 2] No such file or directory windows 10 专业版中的 Docker:python:无法打开文件“manage.py”:[Errno 2] 没有这样的文件或目录 - Docker in windows 10 pro: python: can't open file 'manage.py': [Errno 2] No such file or directory python:无法打开文件“manage.py”:[Errno 2] 没有这样的文件或目录 docker-compose run - python: can't open file 'manage.py': [Errno 2] No such file or directory docker-compose run Docker compose - python:无法打开文件“manage.py”:[Errno 2] 没有这样的文件或目录 - Docker compose - python: can't open file 'manage.py': [Errno 2] No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM