I have
`
$ which ansible
/usr/bin/ansible
user@hostname$ /usr/bin/ansible --version
ansible 2.4.0.0
config file = /users/user/.ansible.cfg
configured module search path = [u’/users/user/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]
ansible python module location = /local/python/lib/python2.7/site-packages/ansible-2.4.0.0-py2.7.egg/ansible
executable location = /usr/bin/ansible
python version = 2.7.14 (default, Oct 10 2017, 13:19:29) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]
`
However, I want Ansible to use
$ which python2.7 /usr/local/bin/python2.7 user@hostname$ python2.7 -V Python 2.7.14
I have the following in my ansible.cfg file in my home dir
ansible_python_interpreter = /usr/local/bin/python2.7
What’s even more confusing is when I run ansible-galaxy to say create a role, it tries to use python2.6 libs, and I get…
`
$ ansible-galaxy init test-dict
Traceback (most recent call last):
File “/usr/bin/ansible-galaxy”, line 4, in
import(‘pkg_resources’).run_script(‘ansible==2.4.0’, ‘ansible-galaxy’)
File “/usr/lib/python2.6/site-packages/pkg_resources/init.py”, line 3037, in
@_call_aside
File “/usr/lib/python2.6/site-packages/pkg_resources/init.py”, line 3021, in _call_aside
f(*args, **kwargs)
File “/usr/lib/python2.6/site-packages/pkg_resources/init.py”, line 3050, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File “/usr/lib/python2.6/site-packages/pkg_resources/init.py”, line 655, in _build_master
ws.require(requires)
File “/usr/lib/python2.6/site-packages/pkg_resources/init.py”, line 969, in require
needed = self.resolve(parse_requirements(requirements))
File “/usr/lib/python2.6/site-packages/pkg_resources/init.py”, line 855, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The ‘cryptography’ distribution was not found and is required by ansible
`
How can I straighten all this out so Ansible uses the /usr/local/*/python2.7 paths?