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.

azure-cli not working on macOS Sierra

See original GitHub issue

Environment summary

Install Method: sudo pip install azure-cli

CLI Version: az version doesn’t run because of error below. azure-cli 2.0.3

OS Version: macOS Sierra 10.12.4 16E195

Shell Type: Bash


Description

After a blank install either “sudo pip install azure-cli” or using “curl -L https://aka.ms/InstallAzureCli | bash” running az shows the following error:

~/Desktop: az
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/site-packages/azure/cli/__main__.py", line 9, in <module>
    import azure.cli.main
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/azure/cli/main.py", line 12, in <module>
    from azure.cli.core.util import (show_version_info_exit, handle_exception)
ImportError: No module named util
~/Desktop: 

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
lutzroedercommented, Apr 24, 2017

both /usr/local/bin/az and ~/Library/azure-cli/bin/az (used a different directory as the default is polluting ~/ on macOS) show the same error.

~/Desktop: which az /usr/local/bin/az

0reactions
derekbekoecommented, Apr 27, 2017

Thanks for the comment @sasukeh. Would recommend a virtual environment as suggested or installing with --user.

Closing issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot install azure cli on macOS via script - virtualenv error
To install Azure CLI on MacOS, I would like to use a bash script and not a package manager like homebrew as recommend...
Read more >
Install the Azure CLI on macOS - Microsoft Learn
Learn how to install and run the Azure CLI on macOS using the homebrew package manager. The Azure CLI has been tested on...
Read more >
Azure-CLI 2.0 Install Fails on Mac - Stack Overflow
I've spent the last two days trying to install Azure CLI 2.0 per instructions on https://learn.microsoft.com/en-us/cli/azure/install-azure-cli ...
Read more >
Azure CLI won't login on MacOS - Intellipaat Community
I have been trying to log into using MACOS but I continuously keep getting errors like this : ... can't reserve a port...
Read more >
Install and Run Azure CLI on Mac | DevOps, Cloud & IT Career
Azure CLI. What is not new to me is working on Azure. And the Azure portal is a great tool, friendly, and easy...
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