When I attempt to use the ansible azure plugin to provision a new vm on azure with azure_rm_virtualmachine I am getting the following error:
failed: [localhost] (item=zk01) => {"changed": false, "item": "zk01", "msg": "Do you have packaging installed? Try
pip install packaging
- No module named packaging.version"}
However, I do happen to have that package installed:
$ pip freeze
adal==0.5.1
ansible==2.5.0
applicationinsights==0.11.2
argcomplete==1.9.4
arrow==0.10.0
asn1crypto==0.24.0
azure-ansible-base==1.0.0
azure-cli-core==2.0.31
azure-cli-nspkg==3.0.2
azure-common==1.1.9
azure-mgmt-compute==2.0.0
azure-mgmt-network==1.3.0
azure-mgmt-nspkg==2.0.0
azure-mgmt-resource==1.1.0
azure-mgmt-storage==1.2.1
azure-nspkg==2.0.0
azure-storage==0.35.1
backports.ssl-match-hostname==3.5.0.1
bcrypt==3.1.4
boto3==1.4.4
botocore==1.5.82
cached-property==1.4.2
certifi==2018.1.18
cffi==1.11.5
chardet==3.0.4
colorama==0.3.9
configparser==3.5.0
cryptography==2.2.2
cx-Oracle==6.0b2
docker==3.2.1
docker-compose==1.20.1
docker-pycreds==0.2.2
dockerpty==0.4.1
docopt==0.6.2
docutils==0.13.1
entrypoints==0.2.3
enum34==1.1.6
Fabric==1.13.1
functools32==3.2.3.post2
futures==3.1.1
httplib2==0.11.3
humanfriendly==4.10
idna==2.6
ipaddress==1.0.19
isodate==0.6.0
Jinja2==2.10
jmespath==0.9.3
jsonschema==2.6.0
keyring==12.0.1
knack==0.3.2
MarkupSafe==1.0
monotonic==1.4
msrest==0.4.27
msrestazure==0.4.26
oauthlib==2.0.7
packaging==16.8 <= See here
paramiko==2.4.1
pexpect==4.2.1
prettytable==0.7.2
ptyprocess==0.5.1
pyasn1==0.4.2
pycparser==2.18
pycrypto==2.6.1
Pygments==2.2.0
PyJWT==1.6.1
PyNaCl==1.2.1
pyOpenSSL==17.5.0
pyparsing==2.2.0
python-dateutil==2.6.0
PyYAML==3.12
requests==2.18.4
requests-oauthlib==0.8.0
s3transfer==0.1.10
six==1.11.0
tabulate==0.8.2
texttable==0.9.1
urllib3==1.22
websocket-client==0.47.0
My suspicion is that it has to do with my local python pointing to the homebrew install of python:
$ which python
/usr/local/bin/python
And the ansible package looking for the native mac version of python:
From azure_rm_virtualmachine.py:
#!/usr/bin/python
It's even more perplexing to me because I have no problems with other ansible modules as I use it extensively.
Does this mean that I should uninstall the homebrew version?