[leapp] Leapp preupgrade failed with "ImportError: cannot import name ssl_match_hostname"

Solution Verified - Updated -


  • When I execute leapp preupgrade, I will get the below error:
Traceback (most recent call last):
  File "/bin/leapp", line 9, in <module>
    load_entry_point('leapp==0.13.0', 'console_scripts', 'leapp')()
  File "/usr/lib/python2.7/site-packages/leapp/cli/__init__.py", line 36, in main
  File "/usr/lib/python2.7/site-packages/leapp/cli/__init__.py", line 25, in _load_commands
    package = pkgutil.get_loader(package_name).load_module(package_name)
  File "/usr/lib64/python2.7/pkgutil.py", line 246, in load_module
    mod = imp.load_module(fullname, self.file, self.filename, self.etc)
  File "/usr/lib/python2.7/site-packages/leapp/cli/commands/list_runs/__init__.py", line 6, in <module>
    from leapp.cli.commands.upgrade.util import fetch_all_upgrade_contexts
  File "/usr/lib/python2.7/site-packages/leapp/cli/commands/upgrade/__init__.py", line 8, in <module>
    from leapp.logger import configure_logger
  File "/usr/lib/python2.7/site-packages/leapp/logger/__init__.py", line 10, in <module>
    from leapp.utils.actorapi import get_actor_api, RequestException
  File "/usr/lib/python2.7/site-packages/leapp/utils/actorapi.py", line 4, in <module>
    import requests
  File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 58, in <module>
    from . import utils
  File "/usr/lib/python2.7/site-packages/requests/utils.py", line 32, in <module>
    from .exceptions import InvalidURL
  File "/usr/lib/python2.7/site-packages/requests/exceptions.py", line 10, in <module>
    from urllib3.exceptions import HTTPError as BaseHTTPError
  File "/usr/lib/python2.7/site-packages/urllib3/__init__.py", line 10, in <module>
    from .connectionpool import (
  File "/usr/lib/python2.7/site-packages/urllib3/connectionpool.py", line 29, in <module>
    from .packages.ssl_match_hostname import CertificateError
  File "/usr/lib/python2.7/site-packages/urllib3/packages/__init__.py", line 3, in <module>
    from . import ssl_match_hostname
ImportError: cannot import name ssl_match_hostname


  • Red Hat Enterprise Linux 7
  • Leapp

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content