gpt4 book ai didi

python - 使用远程 Docker 机器运行/调试 Pycharm Python 脚本

转载 作者:太空狗 更新时间:2023-10-29 20:26:57 24 4
gpt4 key购买 nike

我正在通过 Docker Machine 使用带有 GPU 的远程工作站 (Ubuntu 18.04)。使用 PyCharm Professional 2018.1.4,我可以远程连接到工作站并创建/启动容器,连接到它们并附加一个终端。

当我尝试通过 docker compose 和 PyCharm 运行 python 脚本时出现问题。我收到错误:

python: can't open file '/opt/project/testing.py': [Errno 2] No such file or directory

我有以下 docker-compose 文件:

version: '3'
services:
densepose:
build: Dockerfile
image: densepose
volumes:
- ./:/opt/project # I have tried adding and removing this to no avail
- ./included_files:/included_files
- ./output:/output

我正在使用来自 here 的 Dockerfile

我尝试使用 Ubuntu 17.10 和 Windows 10 与 PyCharm 连接到远程站来执行此操作,但我收到相同的错误。

编辑:
经过更多挖掘,它似乎与 PyCharm 将文件预先复制到远程 docker 机器有关。它应该使用 docker-machine scp 但我还不确定。

最佳答案

路径映射不会将您的文件部署到远程服务器。您需要创建远程服务器配置并将文件上传到远程计算机。

Pycharm 有一个描述的部署工具 here

关于python - 使用远程 Docker 机器运行/调试 Pycharm Python 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51173450/

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