10

I'm using a remote workstation (Ubunutu 18.04) with a GPU via Docker Machine. With PyCharm Professional 2018.1.4 I can connect remotely to the workstation and create/start containers, connect to them and attach a terminal.

The problem occurs when I try to run a python script via docker compose with PyCharm. I get the error:

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

I have the following docker-compose file:

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

And I am using the Dockerfile from here

I have tried using both Ubuntu 17.10 and Windows 10 with PyCharm to connect to the remote station to do this but I receive the same error.

Edit:
After more digging it seems to be related to PyCharm copying files pr-emptively to the remote docker-machine. It should be using docker-machine scp but I'm not sure yet.

2
  • so will the OP be able to award himself the bounty? ;) Commented Jul 6, 2018 at 12:54
  • 2
    Solved it 5 minutes after putting on the bounty... Classic Commented Jul 6, 2018 at 13:02

1 Answer 1

5

Paths mappings don't deploy your files to the remote server. You need to create a remote server configuration and upload your files to the remote machine.

Pycharm has a tool for deployment as described here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.