Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python docker-compose interpreter in Pycharm: Couldn't find docker binary

I am trying to configure the remote python docker-compose interpreter in PyCharm Professional. I am able to run a small project (https://blog.jetbrains.com/pycharm/2017/03/docker-compose-getting-flask-up-and-running/#comment-370730) from the docker container. But when I try to configure it for debugging, setting up of remote interpreter gives me an error saying that docker binary couldn't be found and tells me to install docker.

docker binary error

Has anyone encountered this issue before?

Thanks in advance.

like image 334
mon_ml Avatar asked Oct 19 '18 12:10

mon_ml


People also ask

Does PyCharm Community Edition support Docker?

PyCharm IDE seems good (I downloaded Community Edition, because it's free). But main script is "called" from Docker (I am not quite familiar with it). All sources I've found say that Docker can be added as Remote Interpreter. PyCharm CE has limitations, so it's not possible to add "Remote Interpreter" in this IDE.

What is Docker compose version?

The Compose file is a YAML file defining services, networks, and volumes for a Docker application. The latest and recommended version of the Compose file format is defined by the Compose Specification. The Compose spec merges the legacy 2.

What is a Docker machine?

Docker Machine is a tool for provisioning and managing your Dockerized hosts (hosts with Docker Engine on them). Typically, you install Docker Machine on your local system. Docker Machine has its own command line client docker-machine and the Docker Engine client, docker.


2 Answers

I hit this same issue, from a Mac. I was able to work around it by opening Pycharm from the terminal. You can do so by running: /Applications/PyCharm CE.app/Contents/MacOS/pycharm

Then try configuring the docker-compose interpreter again.

This seems to be an open bug in Pycharm. https://youtrack.jetbrains.com/issue/PY-31727

like image 88
Gabrielle Simard-Moore Avatar answered Sep 23 '22 15:09

Gabrielle Simard-Moore


In my case I just had to restart my IDE. Might be worth trying that before going to any other lengths.

My theory is maybe that Docker was not started up when I opened the IDE, as I had just turned on my computer. PhpStorm is what I was using.

like image 25
Nick Merrill Avatar answered Sep 23 '22 15:09

Nick Merrill