Docker-compose throwing error on any invocation

I installed docker-compose using sudo apt-get install docker-compose

On any invocation (Even just getting version using -v flag), it throws the following:

/usr/lib/python2.7/dist-packages/OpenSSL/ CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography import x509
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 "/home/akost/.local/lib/python2.7/site-packages/pkg_resources/", line 487, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/akost/.local/lib/python2.7/site-packages/pkg_resources/", line 2728, in load_entry_point
    return ep.load()
  File "/home/akost/.local/lib/python2.7/site-packages/pkg_resources/", line 2346, in load
    return self.resolve()
  File "/home/akost/.local/lib/python2.7/site-packages/pkg_resources/", line 2352, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/dist-packages/compose/cli/", line 17, in <module>
    from . import errors
  File "/usr/lib/python2.7/dist-packages/compose/cli/", line 11, in <module>
    from docker.errors import APIError
  File "/usr/lib/python2.7/dist-packages/docker/", line 2, in <module>
    from .api import APIClient
  File "/usr/lib/python2.7/dist-packages/docker/api/", line 2, in <module>
    from .client import APIClient
  File "/usr/lib/python2.7/dist-packages/docker/api/", line 6, in <module>
    import requests
  File "/home/akost/.local/lib/python2.7/site-packages/requests/", line 84, in <module>
    from urllib3.contrib import pyopenssl
  File "/home/akost/.local/lib/python2.7/site-packages/urllib3/contrib/", line 46, in <module>
    import OpenSSL.SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/", line 12, in <module>
    from cryptography import x509
  File "/home/akost/.local/lib/python2.7/site-packages/cryptography/x509/", line 8, in <module>
    from cryptography.x509.base import (
  File "/home/akost/.local/lib/python2.7/site-packages/cryptography/x509/", line 23, in <module>
    from cryptography.x509.extensions import Extension, ExtensionType
  File "/home/akost/.local/lib/python2.7/site-packages/cryptography/x509/", line 28, in <module>
    from cryptography.x509.general_name import GeneralName, IPAddress, OtherName
  File "/home/akost/.local/lib/python2.7/site-packages/cryptography/x509/", line 14, in <module>
    from import Name
  File "/home/akost/.local/lib/python2.7/site-packages/cryptography/x509/", line 29, in <module>
    _ASN1_TYPE_TO_ENUM = {i.value: i for i in _ASN1Type}
TypeError: 'type' object is not iterable

It seems to be a Python error, I’ve reinstalled the cryptography library using pip2.7, still doesn’t work. Any pointers are very much appreciated!

Running Ubuntu 18.04.

Ask Ubuntu Asked by arkostin01 on December 28, 2020

1 Answers

One Answer

Turns out the issue was with python, something in the 'cryptography' package was preventing OpenSSL from being used, fixed it with rm -rf ~/.local/lib/python2.7/site-packages/cryptography.

Answered by arkostin01 on December 28, 2020

Add your own answers!

Related Questions

“Konversation” Dictionary

0  Asked on November 18, 2021 by ron-piggott


How can I record sound in background

0  Asked on November 18, 2021


Configure GRE tunnel to start on reboot?

1  Asked on November 16, 2021 by gulamerah


Can’t install aptik package on ubuntu 15.04

2  Asked on November 16, 2021 by user1099913


KDE Apps on Ubuntu 20.04 – Right Click Issue

1  Asked on November 16, 2021 by timothy-c-quinn


Where are the Xubuntu download verification check sums?

2  Asked on November 16, 2021 by friendfx


Ask a Question

Get help from others!

© 2022 All rights reserved.