$ az feedback
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /usr/local/Cellar/azure-cli/2.0.68/libexec/bin/python
Reason: image not found
/usr/local/bin/az: line 2: 50908 Abort trap: 6 /usr/local/Cellar/azure-cli/2.0.68/libexec/bin/python -m azure.cli "$@"
System: MacOS 10.13.6 (High Sierra)
There are 3 python versions installed:
$ python --version
Python 2.7.10
$ python3 --version
Python 3.6.5
$ /usr/local/Cellar/python/3.7.3/bin/python3 --version
Python 3.7.3
$ brew update
Already up-to-date.
$ brew install azure-cli
==> Downloading https://homebrew.bintray.com/bottles/azure-cli-2.0.68.high_sierra.bottle.tar.gz
Already downloaded: /XXX/Library/Caches/Homebrew/downloads/f8f6a7d6f80c5c9361af6299a84f80618587efbec2d89168494f0293d23735f0--azure-cli-2.0.68.high_sierra.bottle.tar.gz
==> Pouring azure-cli-2.0.68.high_sierra.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
馃嵑 /usr/local/Cellar/azure-cli/2.0.68: 19,122 files, 124.0MB
$ az login
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /usr/local/Cellar/azure-cli/2.0.68/libexec/bin/python
Reason: image not found
/usr/local/bin/az: line 2: 50856 Abort trap: 6 /usr/local/Cellar/azure-cli/2.0.68/libexec/bin/python -m azure.cli "$@"
$ ls -l /usr/local/Cellar/azure-cli/2.0.68/libexec/bin
total 304
-rw-r--r-- 1 2118 10 Jul 12:09 activate
-rwxr-xr-x 1 3492 10 Jul 12:09 activate-global-python-argcomplete*
-rw-r--r-- 1 1450 10 Jul 12:09 activate.csh
-rw-r--r-- 1 3074 10 Jul 12:09 activate.fish
-rw-r--r-- 1 1804 28 Jun 08:12 activate.ps1
-rw-r--r-- 1 1172 10 Jul 12:09 activate.xsh
-rw-r--r-- 1 1512 28 Jun 08:12 activate_this.py
-rwxr-xr-x 1 504 28 Jun 08:12 az*
-rwxr-xr-x 1 86 28 Jun 08:12 az.bat*
-rwxr-xr-x 1 176 28 Jun 08:12 az.completion.sh*
-rwxr-xr-x 1 428 10 Jul 12:09 chardetect*
-rwxr-xr-x 1 273 10 Jul 12:09 easy_install*
-rwxr-xr-x 1 273 10 Jul 12:09 easy_install-3.7*
-rwxr-xr-x 1 411 10 Jul 12:09 fab*
-rwxr-xr-x 1 449 10 Jul 12:09 humanfriendly*
-rwxr-xr-x 1 411 10 Jul 12:09 inv*
-rwxr-xr-x 1 417 10 Jul 12:09 invoke*
-rwxr-xr-x 1 1715 10 Jul 12:09 jp.py*
-rwxr-xr-x 1 425 10 Jul 12:09 keyring*
-rwxr-xr-x 1 191 10 Jul 12:09 pbr*
-rwxr-xr-x 1 255 10 Jul 12:09 pip*
-rwxr-xr-x 1 255 10 Jul 12:09 pip3*
-rwxr-xr-x 1 255 10 Jul 12:09 pip3.7*
-rwxr-xr-x 1 431 10 Jul 12:09 pygmentize*
-rwxr-xr-x 1 412 10 Jul 12:09 pyjwt*
lrwxr-xr-x 1 9 28 Jun 08:12 python@ -> python3.7
-rwxr-xr-x 1 2595 10 Jul 12:09 python-argcomplete-check-easy-install-script*
-rwxr-xr-x 1 314 28 Jun 08:12 python-argcomplete-tcsh*
-rwxr-xr-x 1 2360 10 Jul 12:09 python-config*
lrwxr-xr-x 1 9 28 Jun 08:12 python3@ -> python3.7
-rwxr-xr-x 1 12552 28 Jun 08:12 python3.7*
-rwxr-xr-x 1 1781 10 Jul 12:09 register-python-argcomplete*
-rwxr-xr-x 1 432 10 Jul 12:09 sshtunnel*
-rwxr-xr-x 1 427 10 Jul 12:09 tabulate*
-rwxr-xr-x 1 415 10 Jul 12:09 wheel*
-rwxr-xr-x 1 5942 10 Jul 12:09 wsdump.py*
This virtual env is obviously linked to the the python3.7 installation which should be fine. I'm using it in venvs for development and have not experienced issues with it.
Yikes, sorry you're running into this, @nuarhu. Given that this seems to be a problem with a the linking, you might try thoroughly reinstalling both the CLI and Python via brew. Note, depending on how you created any virtual environments from the brew install of Python (hard or soft links) those venv's will need to be recreated too. If you're okay with that caveat, try the following:
brew uninstall azure-cli
brew uninstall python
brew install python
brew install azure-cli
If that doesn't work, or recreating your virtual environments is too expensive, you can manually install the CLI using a fresh python virtualenv, and pip. Just create and activate a fresh venv, download the Darwin Python3 requirements file, run pip install -r ~/Downloads/requirements.py3.Darwin.txt, and update /usr/local/bin/az to point at the python in your virtual environment.
I'm going to close this for now, because it seems like it may be an outlier. But if folks keep running into it, we should re-open this or file a new issue.
I had the same problem and uninstall then re-install azure cli and python solved the issue for me. Thank you Martin
Uninstall / re-install of python and azure-cli fixed the same issue for me.
Cheers!
Hello,
I ran into this issue today.
$ az login
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /usr/local/Cellar/azure-cli/2.6.0/libexec/bin/python
Reason: image not found
/usr/local/bin/az: line 2: 2845 Abort trap: 6 AZ_INSTALLER=HOMEBREW /usr/local/Cellar/azure-cli/2.6.0/libexec/bin/python -m azure.cli "$@"
I tried to uninstall and reinstall as per the above post
brew uninstall azure-cli
brew uninstall python
brew install python
brew install azure-cli
I still received the same error
hi,
I tried to uninstall and reinstall as per the above post
brew uninstall azure-cli brew uninstall python brew install python brew install azure-cli.
error:
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /usr/local/Cellar/azure-cli/2.8.0/libexec/bin/python
Reason: image not found
/usr/local/bin/az: line 2: 9193 Abort trap: 6 AZ_INSTALLER=HOMEBREW /usr/local/Cellar/azure-cli/2.8.0/libexec/bin/python -m azure.cli "$@"
I still received the same error too
@fengzhou-msft to help take a look
Any update on this? I am having the same issue. Tried uninstall/install of python and azure-cli.
$ az login
/usr/local/bin/az: line 2: 89472 Abort trap: 6 AZ_INSTALLER=HOMEBREW /usr/local/Cellar/azure-cli/2.8.0/libexec/bin/python -m azure.cli "$@"
Please don't reinstall python as cli depends on python 3.8 now and will install it as a dependency. Try:
brew uninstall azure-cli
brew uninstall python
brew install azure-cli
@fengzhou-msft Thank you for the response. I have tried your suggestion with the same result.
$ brew uninstall azure-cli
$ brew uninstall python
$ brew install azure-cli
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
buildozer gofish terraform-ls
==> Updated Formulae
aws-cdk docker-compose-completion grin-wallet libphonenumber rust
bit exploitdb john mercurial swiftformat
docker-compose grin lego nasm ungit
==> Updated Casks
aerial eset-cyber-security-pro lastpass macx-dvd-ripper-pro
agenda iterm2 libreoffice
==> Downloading https://homebrew.bintray.com/bottles/azure-cli-2.8.0.catalina.bottle.tar.gz
Already downloaded: /Users/xxxxx/Library/Caches/Homebrew/downloads/75d03394393a3039aff647b7064a11c178f9b423bc2e8519ea716e6dbd87a0bd--azure-cli-2.8.0.catalina.bottle.tar.gz
==> Pouring azure-cli-2.8.0.catalina.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
馃嵑 /usr/local/Cellar/azure-cli/2.8.0: 14,887 files, 181.3MB
$ az login
/usr/local/bin/az: line 2: 7830 Abort trap: 6 AZ_INSTALLER=HOMEBREW /usr/local/Cellar/azure-cli/2.8.0/libexec/bin/python -m azure.cli "$@"
Please don't reinstall python as cli depends on python 3.8 now and will install it as a dependency. Try:
brew uninstall azure-cli brew uninstall python brew install azure-cli
my python version was Python 2.7.16.
~/ % python --version
Python 2.7.16
sorry,I still received the same error :
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /usr/local/Cellar/azure-cli/2.8.0/libexec/bin/python
Reason: image not found
/usr/local/bin/az: line 2: 23423 Abort trap: 6 AZ_INSTALLER=HOMEBREW /usr/local/Cellar/azure-cli/2.8.0/libexec/bin/python -m azure.cli "$@"
I got it the right way.
try:
~ % pip3 install azure-cli
~ % az
Welcome to Azure CLI!
Use
az -hto see available commands or go to https://aka.ms/cli.
if you dont have pip3, please install first.
I finally got it to work.
Most helpful comment
Yikes, sorry you're running into this, @nuarhu. Given that this seems to be a problem with a the linking, you might try thoroughly reinstalling both the CLI and Python via brew. Note, depending on how you created any virtual environments from the brew install of Python (hard or soft links) those venv's will need to be recreated too. If you're okay with that caveat, try the following:
If that doesn't work, or recreating your virtual environments is too expensive, you can manually install the CLI using a fresh python virtualenv, and
pip. Just create and activate a fresh venv, download the Darwin Python3 requirements file, runpip install -r ~/Downloads/requirements.py3.Darwin.txt, and update /usr/local/bin/az to point at the python in your virtual environment.