問題
最近遇到一個問題,就是在suse 12上安裝一個azure cli。現在azure cli上基本不支持python2.x系列,必須要python3.x,然後自己搗鼓編譯python3.x。發現這真的太難啦,根本就沒有解決依賴問題。後面是通過下載azure cli的指定版本解決的。
解決
安裝python2-virtualenv虛擬環境
- zypper addrepo https://download.opensuse.org/repositories/devel:languages:python/SLE_12_SP4/devel:languages:python.repo
- zypper refresh
- zypper install python-virtualenv
安裝azure-cli-2.0.68
- curl -L https://aka.ms/InstallAzureCli | bash
總結
如果在安裝後以及在使用 bash 或 zsh 時無法運行該命令,請清除 shell 的命令哈希緩存。 運行
hash -r
並查看問題是否得到解決。
如果在安裝後沒有重啓 shell,也可能出現此錯誤。 確保 az 命令的位置在 $PATH 中。 az 命令的位置爲
<install path>/bin