TypeError: build() got an unexpected keyword argument 'stream'

If you can docker-compose up -d and got the TypeError: build() got an unexpected keyword argument 'stream', then you will need to uninstall docker-compose, install the python docker-compose page then reinstall the OS package.
TypeError: build() got an unexpected keyword argument 'stream'

Tried to run docker-compose on a trivial docker-compose.yml, and it crashes with the error message below. Unable to get it working on anything since upgrading from docker-compose-1.8.0 to docker-compose-1.23.1. Alternatively, you can install the python docker-compose package.

Building web
Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 11, in <module>
    load_entry_point('docker-compose==1.17.1', 'console_scripts', 'docker-compose')()
  File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 68, in main
    command()
  File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 121, in perform_command
    handler(command, command_options)
  File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 952, in up
    start=not no_start
  File "/usr/lib/python2.7/dist-packages/compose/project.py", line 431, in up
    svc.ensure_image_exists(do_build=do_build)
  File "/usr/lib/python2.7/dist-packages/compose/service.py", line 318, in ensure_image_exists
    self.build()
  File "/usr/lib/python2.7/dist-packages/compose/service.py", line 923, in build
    shmsize=parse_bytes(build_opts.get('shm_size')) if build_opts.get('shm_size') else None,
TypeError: build() got an unexpected keyword argument 'stream'

Here are the steps to resolving the TypeError: build() got an unexpected keyword argument 'stream':

  1. Uninstall OS docker-compose 
    sudo apt remove docker-compose​
  2. Install the python package 
    sudo pip install -U docker-compose​
  3. Reinstall the OS docker-compose package 
    sudo apt install docker-compose -y​

You should be able to run docker-compose successful now.

Go Back
Menu
×