When configuring SSL Certificate, the error `ImportError: can not import name UnrewindableBodyError`

Problem Description

	Traceback (most recent call last):
  File "/usr/bin/tower-cli", line 11, in <module>
    load_entry_point('ansible-tower-cli==3.3.0', 'console_scripts', 'tower-cli')()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 479, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2703, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2321, in load
    return self.resolve()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2327, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/site-packages/tower_cli/cli/run.py", line 17, in <module>
    from tower_cli.cli.base import TowerCLI
  File "/usr/lib/python2.7/site-packages/tower_cli/cli/base.py", line 25, in <module>
    from tower_cli.cli import misc
  File "/usr/lib/python2.7/site-packages/tower_cli/cli/misc.py", line 24, in <module>
    from requests.auth import HTTPBasicAuth
  File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  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 31, in <module>
    from .connection import (
  File "/usr/lib/python2.7/site-packages/urllib3/connection.py", line 45, in <module>
    from .util.ssl_ import (
  File "/usr/lib/python2.7/site-packages/urllib3/util/__init__.py", line 4, in <module>
    from .request import make_headers
  File "/usr/lib/python2.7/site-packages/urllib3/util/request.py", line 5, in <module>
    from ..exceptions import UnrewindableBodyError
	ImportError: cannot import name UnrewindableBodyError

Problem Cause and Solution

This seems to be a request, rather than tower-cli. You can try reinstalling the request and in accordance with the following steps to view urlib3

# sudo pip uninstall requests
# sudo pip uninstall urllib3
# sudo yum remove python-urllib3
# sudo yum remove python-requests

By executing the following command to confirm that all the above libraries:

# rpm -qa | grep requests 
# pip freeze | grep requests

Now, using yum install these packages:

# sudo yum install python-urllib3
# sudo yum install python-requests

reference

https://github.com/ansible/tower-cli/issues/603

Guess you like

Origin www.cnblogs.com/codecheng99/p/12620850.html