Trouble with run configuration for remote docker interpreter

I am trying to run my code in a remote docker container. I have successfully configured the interpreter, and I confirmed this by checking to see that all the libraries installed are indeed there.

The folder "src" is a mounted

But now when I try to run it by simply right-clicking on the file and running it, I get:

Error running 'wsgi': Cannot run the remote Python interpreter: invalid volume specification: 'C:\\FILES\boates\work_local\_code2\leni-exec:/opt/project:rw'

So from this error I guessed that I should change the volume binding. The host path was defined as my local path (which is on Windows). So I replaced it with the path as it appears on the remote host (Linux), and the "Docker container settings box" now appears as:

--entrypoint -v /home/boates/_code/leni-exec:/opt/project --rm

Now I get another error:

Error running 'wsgi': Cannot run the remote Python interpreter: the working directory 'C:\\FILES\boates\work_local\_code2\\leni-exec\\src is invalid, it needs to be an absolute path' 

Ok, so at this point I guess that the working directory must also be defined as being inside the host machine? So I change it to this:


Now another error:

Error running 'wsgi': Cannot run the remote Python interpreter: create \\home\\boates\\_code\\leni-exec: \"\\\\home\\\\boates\\\\_code\\\\leni-exec\" includes invalid characters for a local volume name, only \"[a-zA-Z0-9][a-zA-Z0-9_.-]\" are allowed. If you intended to pass a host directory, use absolute path

At this point I am at a loss. I cannot figure out how to make this work and these errors are really not helping me anymore. Can someone please tell me how I can make this work? Here are all my configurations:

1 comment
Comment actions Permalink

Hi, PyCharm has two ways to run the code with the Docker interpreter. The Docker run/debug configuration, which is the same as running the container from the terminal using `docker run`. And the Python run/debug configuration, which automatically mounts your project root to the container if run with the Docker interpreter. Only the latter supports debugging so I guess this is what you want (your second to the last screenshot).

Also, the Deployment is not used when working with the Docker interpreter (it is used mainly for SSH interpreter).

Assuming our goal is to run the code with the Python configuration - please show a screenshot of your interpreter settings , specifically I'm interested if you have any path mappings configured there. And also if you have any path mappings in the Docker daemon settings **Preferences | Build, Execution, Deployment | Docker**.

Which error do you get when you run the Python configuration?


Please sign in to leave a comment.