cannot import name ‘ImageNotFound‘ from ‘docker.errors‘

使用docker-compose出错

Traceback (most recent call last):
  File "/opt/AN/bin/docker-compose", line 5, in 
    from compose.cli.main import main
  File "/opt/AN/lib/python3.7/site-packages/compose/cli/main.py", line 35, in 
    from ..project import get_image_digests
  File "/opt/AN/lib/python3.7/site-packages/compose/project.py", line 14, in 
    from docker.errors import ImageNotFound
ImportError: cannot import name 'ImageNotFound' from 'docker.errors' (/opt/AN/lib/python3.7/site-packages/docker/errors.py)

解决方法:

pip3 uninstall docker-compose
pip3 install docker-compose

 

你可能感兴趣的:(Linux,Python)