diff --git a/bin/ansible b/bin/ansible index b82a18d3d3e..7ba615dbc0a 100755 --- a/bin/ansible +++ b/bin/ansible @@ -19,6 +19,17 @@ ######################################################## +__requires__ = ['ansible'] +try: + import pkg_resources +except Exception: + # Use pkg_resources to find the correct versions of libraries and set + # sys.path appropriately when there are multiversion installs. But we + # have code that better expresses the errors in the places where the code + # is actually used (the deps are optional for many code paths) so we don't + # want to fail here. + pass + import os import sys diff --git a/bin/ansible-playbook b/bin/ansible-playbook index 93645903f79..d25a3710d87 100755 --- a/bin/ansible-playbook +++ b/bin/ansible-playbook @@ -19,7 +19,15 @@ ####################################################### __requires__ = ['ansible'] -import pkg_resources +try: + import pkg_resources +except Exception: + # Use pkg_resources to find the correct versions of libraries and set + # sys.path appropriately when there are multiversion installs. But we + # have code that better expresses the errors in the places where the code + # is actually used (the deps are optional for many code paths) so we don't + # want to fail here. + pass import sys import os diff --git a/bin/ansible-vault b/bin/ansible-vault index 3079b31d9ed..22cfc0e1487 100755 --- a/bin/ansible-vault +++ b/bin/ansible-vault @@ -19,7 +19,15 @@ # http://docs.ansible.com/playbooks_vault.html for more details. __requires__ = ['ansible'] -import pkg_resources +try: + import pkg_resources +except Exception: + # Use pkg_resources to find the correct versions of libraries and set + # sys.path appropriately when there are multiversion installs. But we + # have code that better expresses the errors in the places where the code + # is actually used (the deps are optional for many code paths) so we don't + # want to fail here. + pass import os import sys