Docker Community Forums

Share and learn in the Docker community.

Compose crash on a fresh Raspbian installation

I just did a fresh installation of Docker and Compose on a Raspberry Pi3. Docker run fine. But when I try to do anything with Compose, I get this error

pi@raspberrypi:~ $ docker-compose
Traceback (most recent call last):
  File "/usr/local/bin/docker-compose", line 6, in <module>
    from compose.cli.main import main
  File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 52, in <module>
    from .formatter import ConsoleWarningFormatter
  File "/usr/local/lib/python2.7/dist-packages/compose/cli/formatter.py", line 15, in <module>
    from backports.shutil_get_terminal_size import get_terminal_size
ImportError: No module named shutil_get_terminal_size

Compose was installed through pip. Any idea what could be missing?

I too am having this identical issue.

I am installing Docker and Docker-Compose over OctoPrint’s latest image.
Then I ran apt-get update && apt-get upgrade,
followed by this guide:

Earlier, i was having other issues. And I got so fed up trying to resolve it after those issues went away and this one popped up that I just wound up re-etching the octoprint image onto a new SD card (thinking I had a bad OS and decided to reinstall everything).

Which brought me back here.

1 Like

For those interested in the fix here; just switch to python 3 with the following:

sudo apt install -y python3 python3-pip
sudo pip3 install docker-compose

I’ve updated the post.