question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`No module named azure.cli`

See original GitHub issue

Description

I’m pretty sure this can be fixed with a “start all over again from scratch”, but just wanted to let you know just in case some environmental issues are lurking here.

This is the deal. I run az login and get

az login
/usr/bin/python: No module named azure.cli

Environment summary

Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here:

pip install --user azure-cli

(back in January or so)

Just today:

pip install --user --upgrade azure-cli

CLI Version: What version of the CLI and modules are installed? (Use az --version)
Answer here:

Hard to say, since I can’t run az. However, here’s what the upgrade issues:

uccessfully installed PyJWT-1.5.0 adal-0.4.5 appdirs-1.4.3 argcomplete-1.8.2 asn1crypto-0.22.0 azure-batch-2.0.1 azure-cli-2.0.6 azure-cli-acr-2.0.4 azure-cli-acs-2.0.6 azure-cli-appservice-0.1.6 azure-cli-batch-2.0.4 azure-cli-cdn-0.0.2 azure-cli-cloud-2.0.2 azure-cli-cognitiveservices-0.1.2 azure-cli-command-modules-nspkg-2.0.0 azure-cli-component-2.0.4 azure-cli-configure-2.0.6 azure-cli-core-2.0.6 azure-cli-cosmosdb-0.1.6 azure-cli-dla-0.0.6 azure-cli-dls-0.0.6 azure-cli-feedback-2.0.2 azure-cli-find-0.2.2 azure-cli-interactive-0.3.1 azure-cli-iot-0.1.5 azure-cli-keyvault-2.0.4 azure-cli-lab-0.0.4 azure-cli-monitor-0.0.4 azure-cli-network-2.0.6 azure-cli-nspkg-3.0.0 azure-cli-profile-2.0.4 azure-cli-rdbms-0.0.1 azure-cli-redis-0.2.3 azure-cli-resource-2.0.6 azure-cli-role-2.0.4 azure-cli-sf-1.0.1 azure-cli-sql-2.0.3 azure-cli-storage-2.0.6 azure-cli-vm-2.0.6 azure-common-1.1.5 azure-datalake-store-0.0.8 azure-keyvault-0.2.0 azure-mgmt-batch-3.0.1 azure-mgmt-cdn-0.30.2 azure-mgmt-cognitiveservices-1.0.0 azure-mgmt-compute-1.0.0rc1 azure-mgmt-containerregistry-0.2.1 azure-mgmt-datalake-analytics-0.1.4 azure-mgmt-datalake-nspkg-2.0.0 azure-mgmt-datalake-store-0.1.4 azure-mgmt-devtestlabs-2.0.0 azure-mgmt-dns-1.0.1 azure-mgmt-documentdb-0.1.3 azure-mgmt-iothub-0.2.2 azure-mgmt-keyvault-0.31.0 azure-mgmt-monitor-0.2.1 azure-mgmt-network-1.0.0rc3 azure-mgmt-nspkg-2.0.0 azure-mgmt-rdbms-0.1.0 azure-mgmt-redis-1.0.0 azure-mgmt-resource-1.1.0rc1 azure-mgmt-sql-0.4.0 azure-mgmt-storage-1.0.0rc1 azure-mgmt-trafficmanager-0.30.0 azure-mgmt-web-0.32.0 azure-monitor-0.3.0 azure-multiapi-storage-0.1.0 azure-nspkg-2.0.0 azure-servicefabric-5.6.130 certifi-2017.4.17 cffi-1.10.0 colorama-0.3.9 cryptography-1.8.1 futures-3.1.1 idna-2.5 ipaddress-1.0.18 jmespath-0.9.2 keyring-10.3.2 msrest-0.4.7 msrestazure-0.4.7 oauthlib-2.0.2 packaging-16.8 paramiko-2.1.2 pathlib2-2.2.1 prompt-toolkit-1.0.14 pyasn1-0.2.3 pycparser-2.17 pydocumentdb-2.2.0 pygments-2.2.0 pyopenssl-17.0.0 pyparsing-2.2.0 python-dateutil-2.6.0 requests-2.14.2 requests-oauthlib-0.8.0 scandir-1.5 secretstorage-2.3.1 setuptools-35.0.2 vsts-cd-manager-0.118.0 wcwidth-0.1.7 whoosh-2.7.4 xmltodict-0.11.0
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning

OS Version: What OS and version are you using?
Answer here:

Linux penny 3.13.0-34-generic #60-Ubuntu SMP Wed Aug 13 15:45:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

That’s Ubuntu 14.04 server

Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here:

zsh 5.0.5 (x86_64-pc-linux-gnu)

Thanks for any answer!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
fizwitcommented, Nov 14, 2017

Same issue. bin/python: No module named azure.cli re-install of azure-cli does not fix the issue. OS: Ubuntu 14.04 Python: 2.7.13

Creating the missing _init.py file fixed the issue.

touch  $PYTHONPATH/azure_cli-2.0.20-py2.7.egg/ __init__.py
chmod +x $PYTHONPATH/azure_cli-2.0.20-py2.7.egg/__init__.py
touch $PYTHONPATH/azure_cli-2.0.20-py2.7.egg/azure/__init__.py
chmod +x $PYTHONPATH/azure_cli-2.0.20-py2.7.egg/azure/__init__.py
2reactions
mayuridcommented, May 19, 2017

Did you run the following pip install --force-reinstall --upgrade azure-nspkg azure-mgmt-nspkg.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ansible Runner fails with `No Module named Azure.cli`
For the error try to uninstall all of the above ansible ,python and cli . And install the ansible by using below cmdlts...
Read more >
ModuleNotFoundError: No module named 'azure-cli'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'azure-cli' How to remove the ModuleNo.
Read more >
[Fixed] ModuleNotFoundError: No module named 'azure-core'
How to Fix “ModuleNotFoundError: No module named 'azure-core'” in PyCharm · Open File > Settings > Project from the PyCharm menu. · Select...
Read more >
Install the Azure CLI on Linux - Microsoft Learn
You can install the Azure CLI on Linux computers with one command or a ... you may encounter issues such as no module...
Read more >
"No module named 'azure.cli.core.auth' " : r/ansible - Reddit
AWX/Ansible Tower - unable to resolve Module Dependency - "No module named 'azure.cli.core.auth' ". I'm trying to install the Azure.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found