-
Notifications
You must be signed in to change notification settings - Fork 144
Azure: faq
When running ansible or ansible-playbook with azure modules, youm may meet error message "Do you have azure>=2.0.0 installed? No module named XXXX".
Actually you have already installed the Azure SDK libraries when installing ansible[azure]
modules.
-
The libraries is installed by pip3 and under python 3.XXXX folder, but ansible uses python 2 to load libraries.
-
You install azure libraries into different pip library path. Some may be in the system path like
/usr/lib/...
, some may be under your profile folder like~/.username/lib/...
. One of the library path is not in your PYTHONPATH, the python interpreter failed to find the library. -
There are many libraries named
azure.mgmt....
, they maybe installed in different folders. E.G.azure.mgmt.web
is under/usr/lib/...
, whileazure.mgmt.compute
is under~/.username/lib...
. When python try to importazure.mgmt.compute
, it first imports the azure package. Unfortunately, your python find azure under/usr/lib
forazure.mgmt.web
, it searchesmgmt.compute
under this folder, failed and throw such exception. Here we need to move them into one directory.
-
Check your packages is already installed, check whether the missing package is in the returned list.
pip freeze
-
Check whether the package path is in the PYTHONPATH:
-
check your python sys path:
python -c "import sys; print(sys.path)"
-
find your target package path
sudo find / | grep '<your missing package name>'
-
check the step2's path is in the setp1's sys path. If not, add the
PYTHONPATH
byexport PYTHONPATH=PYTHONPATH:<path found in previous step>
-
-
Your
azure.mgmt.XXX
is installed in different path from other azure mgmt packages.-
find the
azure/mgmt/web
path bysudo find / | grep "azure/mgmt/web"
, and note it asweb_path
-
enter python bash by typing
python
-
find azure path by the following python script and not the
azure.__file__
path asazure_path
.import azure; azure.__file__; exit()
-
copy the
azure-mgmt-web
package to the azure directory bysudo cp -rf <web-path>/azure/* <azure-path>/
-
This Wiki is used for quick notes, not for support or documentation.
Working groups are now in the Ansible forum
Ansible project:
Community,
Contributor Experience,
Docs,
News,
Outreach,
RelEng,
Testing
Cloud:
AWS,
Azure,
CloudStack,
Container,
DigitalOcean,
Docker,
hcloud,
Kubernetes,
Linode,
OpenStack,
oVirt,
Virt,
VMware
Networking:
ACI,
AVI,
F5,
Meraki,
Network,
NXOS
Ansible Developer Tools:
Ansible-developer-tools
Software:
Crypto,
Foreman,
GDrive,
GitLab,
Grafana,
IPA,
JBoss,
MongoDB,
MySQL,
PostgreSQL,
RabbitMQ,
Zabbix
System:
AIX,
BSD,
HP-UX,
macOS,
Remote Management,
Solaris,
Windows
Security:
Security-Automation,
Lockdown
Tooling:
AWX,
Galaxy,
Molecule
Plugins:
httpapi