subscription-manager throws `AttributeError:'module' object has no attribute 'PY2'`
Issue
- Unable to execute any subscription-manager command due to the error of
AttributeError: 'module' object has no attribute 'PY2'
# subscription-manager status
Traceback (most recent call last):
File "/usr/sbin/subscription-manager", line 9, in <module>
load_entry_point('subscription-manager==1.21.10', 'console_scripts', 'subscription-manager')()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib64/python2.7/site-packages/subscription_manager/scripts/subscription_manager.py", line 29, in <module>
if six.PY2:
AttributeError: 'module' object has no attribute 'PY2'
Environment
- Red Hat Enterprise Linux
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.