зеркало из https://github.com/Azure/azure-cli.git
[Docs] Update and improve readability of install instructions (#1584)
* Update and improve readability of install instructions - Create common install issues doc - Move developer set up - Create Linux install prereq doc - Additional component instructions - Nightly instructions on README - Remove pypi version shield The PyPI version of azure-cli is not significant. * lowercase install troubleshooting
This commit is contained in:
Родитель
575de6b789
Коммит
4d1abf122d
141
README.rst
141
README.rst
|
@ -1,9 +1,6 @@
|
|||
Microsoft Azure CLI 2.0 - Preview
|
||||
==================================
|
||||
|
||||
.. image:: https://img.shields.io/pypi/v/azure-cli.svg?maxAge=2592000
|
||||
:target: https://pypi.python.org/pypi/azure-cli
|
||||
|
||||
.. image:: https://img.shields.io/pypi/pyversions/azure-cli.svg?maxAge=2592000
|
||||
:target: https://pypi.python.org/pypi/azure-cli
|
||||
|
||||
|
@ -15,101 +12,79 @@ A great cloud needs great tools; we're excited to introduce *Azure CLI 2.0 - Pre
|
|||
Installation
|
||||
===============
|
||||
|
||||
Developer Setup
|
||||
^^^^^^^^^
|
||||
If you would like to setup a development environment and contribute to the CLI, see the following document:
|
||||
https://github.com/Azure/azure-cli/blob/master/doc/configuring_your_machine.md
|
||||
A list of common install issues and their resolutions are available at `install troubleshooting <https://github.com/Azure/azure-cli/blob/master/doc/install_troubleshooting.md>`__.
|
||||
|
||||
Upgrading
|
||||
^^^^^^^^^
|
||||
**How would you like to install?**
|
||||
|
||||
If you already have the CLI installed, run the following to update:
|
||||
- `Interactive install script <#interactive-install-script>`__
|
||||
- `Pip <#pip>`__
|
||||
- `Apt-get <#apt-get>`__
|
||||
- `Docker <#docker>`__
|
||||
- `Nightly Builds <#nightly-builds>`__
|
||||
- `Developer Setup <#developer-setup>`__
|
||||
|
||||
.. code-block:: console
|
||||
Interactive install script
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
$ az component update
|
||||
|
||||
If you don't have the CLI installed, see below.
|
||||
|
||||
Install with interactive install script
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
For OSX and Linux, you can install using curl:
|
||||
On Linux, see our `prerequisites <https://github.com/Azure/azure-cli/blob/master/doc/install_linux_prerequisites.md>`__.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -L https://aka.ms/InstallAzureCli | bash
|
||||
|
||||
or using wget:
|
||||
or:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ wget -q -O - https://aka.ms/InstallAzureCli | bash
|
||||
|
||||
Some prerequisites may be required. See our `Preview Install Guide <https://github.com/Azure/azure-cli/blob/master/doc/preview_install_guide.md>`__.
|
||||
Install additional components with ``$ az component update --add <component_name>``
|
||||
|
||||
If you run into an ``AttributeError: 'X509' object has no attribute '_x509'`` error, downgrade your version of the requests library from 2.12.1 to 2.11.1.
|
||||
With the default install location, use ``/usr/local/az/bin/pip install requests==2.11.1``.
|
||||
Pip
|
||||
^^^
|
||||
|
||||
Install with pip
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
For those familiar with pip, use the following:
|
||||
On Linux, see our `prerequisites <https://github.com/Azure/azure-cli/blob/master/doc/install_linux_prerequisites.md>`__.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ pip install --user azure-cli
|
||||
|
||||
You may need to modify your PATH to include the directory ``az`` is installed to:
|
||||
Install additional components with ``$ az component update --add <component_name>``
|
||||
|
||||
**On Linux:**
|
||||
Enable tab completion with ``source az.completion.sh`` (not available on Windows CMD).
|
||||
|
||||
.. code-block:: console
|
||||
You may need to modify your PATH:
|
||||
|
||||
$ export PATH=$PATH:~/.local/bin
|
||||
**Linux**
|
||||
|
||||
Permanently include this change by modifying your rc file:
|
||||
``$ export PATH=$PATH:~/.local/bin``
|
||||
|
||||
.. code-block:: console
|
||||
**OS X**
|
||||
|
||||
$ echo "PATH=\$PATH:~/.local/bin" >> ~/.bashrc
|
||||
``export PATH=$PATH:~/Library/Python/X.Y/bin``
|
||||
|
||||
**On OS X:**
|
||||
**Windows**
|
||||
|
||||
.. code-block:: console
|
||||
Add ``%APPDATA%\Python\PythonXY\Scripts`` to your PATH.
|
||||
|
||||
export PATH=$PATH:~/Library/Python/X.Y/bin
|
||||
Where X, Y is your Python version.
|
||||
|
||||
Where X.Y is your Python version.
|
||||
Apt-get
|
||||
^^^^^^^
|
||||
|
||||
Permanently include this change by modifying your rc file:
|
||||
For Debian/Ubuntu based systems.
|
||||
|
||||
.. code-block:: console
|
||||
First, modify your sources list:
|
||||
|
||||
$ echo "PATH=\$PATH:~/Library/Python/X.Y/bin" >> ~/.bash_profile
|
||||
**32 bit system**
|
||||
|
||||
**On Windows:**
|
||||
``$ echo "deb https://apt-mo.trafficmanager.net/repos/azure-cli/ wheezy main" | sudo tee /etc/apt/sources.list.d/azure-cli.list``
|
||||
|
||||
Add ``%APPDATA%\Python\PythonXY\Scripts`` to your PATH.
|
||||
Where XY is your Python version.
|
||||
**64 bit system**
|
||||
|
||||
Enable tab completion with ``source az.completion.sh``.
|
||||
``$ echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/azure-cli/ wheezy main" | sudo tee /etc/apt/sources.list.d/azure-cli.list``
|
||||
|
||||
Some prerequisites may be required. See our `Preview Install Guide <https://github.com/Azure/azure-cli/blob/master/doc/preview_install_guide.md>`__.
|
||||
|
||||
If you run into an ``AttributeError: 'X509' object has no attribute '_x509'`` error, downgrade your version of the requests library from 2.12.1 to 2.11.1.
|
||||
Use ``pip install requests==2.11.1``.
|
||||
|
||||
NOTE: If in a virtual environment, you can simply use ``pip install azure-cli`` and the CLI will be installed into that virtual environment.
|
||||
|
||||
Install with apt-get
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A Debian/Ubuntu package is also available. Install as follows:
|
||||
|
||||
On a 32 bit system: ``$ echo "deb https://apt-mo.trafficmanager.net/repos/azure-cli/ wheezy main" | sudo tee /etc/apt/sources.list.d/azure-cli.list``
|
||||
|
||||
On a 64 bit system: ``$ echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/azure-cli/ wheezy main" | sudo tee /etc/apt/sources.list.d/azure-cli.list``
|
||||
Run the following:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
|
@ -117,26 +92,51 @@ On a 64 bit system: ``$ echo "deb [arch=amd64] https://apt-mo.trafficmanager.net
|
|||
$ sudo apt-get install apt-transport-https
|
||||
$ sudo apt-get update && sudo apt-get install azure-cli
|
||||
|
||||
Install with Docker
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
Docker (versioned)
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
We also maintain a Docker image preconfigured with the Azure CLI.
|
||||
|
||||
Tagged Docker images are available.
|
||||
See our `Docker tags <https://hub.docker.com/r/azuresdk/azure-cli-python/tags/>`__ for available versions.
|
||||
We maintain a Docker image preconfigured with the Azure CLI.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ docker run -v ${HOME}:/root -it azuresdk/azure-cli-python:<version>
|
||||
|
||||
See our `Docker tags <https://hub.docker.com/r/azuresdk/azure-cli-python/tags/>`__ for available versions.
|
||||
|
||||
Docker (automated)
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Run the latest automated Docker build with the command below.
|
||||
All command modules are included in this version as the image is built directly from the Git repository.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ docker run -v ${HOME}:/root -it azuresdk/azure-cli-python:latest
|
||||
|
||||
For installation steps for common platforms, as well as dependency troubleshooting, please take a look at our `installation guide <http://github.com/Azure/azure-cli/blob/master/doc/preview_install_guide.md>`__.
|
||||
All command modules are included in this version as the image is built directly from the Git repository.
|
||||
|
||||
Nightly Builds
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
Install nightly builds with pip in a virtual environment.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ pip install --pre azure-cli --extra-index-url https://azureclinightly.blob.core.windows.net/packages
|
||||
|
||||
- Builds happen at 21:00:00 PDT each night. They are published shortly afterwards.
|
||||
- Whilst all command modules are built each nightly, not all are are included on install.
|
||||
- Install additional components with:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ export AZURE_COMPONENT_PACKAGE_INDEX_URL=https://azureclinightly.blob.core.windows.net/packages
|
||||
$ az component update --add <component_name> --private
|
||||
|
||||
- To view the list of installed packages, run ``az component list``
|
||||
|
||||
Developer Setup
|
||||
^^^^^^^^^^^^^^^
|
||||
If you would like to setup a development environment and contribute to the CLI, see `Configuring Your Machine <https://github.com/Azure/azure-cli/blob/master/doc/configuring_your_machine.md>`__.
|
||||
|
||||
|
||||
Usage
|
||||
|
@ -173,8 +173,6 @@ Here are a few features and concepts that can help you get the most out of the A
|
|||
:width: 600
|
||||
:height: 300
|
||||
|
||||
|
||||
|
||||
|
||||
The following examples are showing using the ``--output table`` format, you can change your default using the ``$ az configure`` command.
|
||||
|
||||
|
@ -242,8 +240,6 @@ Reporting issues and feedback
|
|||
|
||||
If you encounter any bugs with the tool please file an issue in the `Issues <https://github.com/Azure/azure-cli/issues>`__ section of our GitHub repo.
|
||||
|
||||
Before posting an issue, please review our list of `Common Issues <https://github.com/Azure/azure-cli/issues?q=label%3AFAQ+is%3Aclosed>`__. These are issues we have closed because we cannot address them within the CLI due to platform or language limitations.
|
||||
|
||||
To provide feedback from the command line, try the ``az feedback`` command.
|
||||
|
||||
Contribute Code
|
||||
|
@ -256,7 +252,6 @@ For more information see the `Code of Conduct FAQ <https://opensource.microsoft.
|
|||
If you would like to become an active contributor to this project please
|
||||
follow the instructions provided in `Microsoft Azure Projects Contribution Guidelines <http://azure.github.io/guidelines.html>`__
|
||||
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
|
|
|
@ -0,0 +1,91 @@
|
|||
Linux Install Prerequisites
|
||||
===========================
|
||||
|
||||
Some native Linux packages are required when installing the CLI with:
|
||||
- Interactive install script
|
||||
- ``pip``
|
||||
|
||||
The commands to run to install the dependencies for some common distributions are listed below.
|
||||
|
||||
* Ubuntu
|
||||
* [12.04 LTS](#ubuntu-1204-lts)
|
||||
* [14.04 LTS](#ubuntu-1404-lts-and-bash-on-windows-build-14362)
|
||||
* [15.10](#ubuntu-1510)
|
||||
* [16.04 LTS](#ubuntu-1604-lts)
|
||||
* Debian
|
||||
* [7](#debian-7)
|
||||
* [8](#debian-8)
|
||||
* CentOS
|
||||
* [6.5 - 6.7](#centos-65--66--67)
|
||||
* [7.1 - 7.2](#centos-71--72)
|
||||
* RHEL
|
||||
* [6.7](#redhat-rhel-67)
|
||||
* [7.2](#redhat-rhel-72)
|
||||
* [SUSE](#suse-opensuse-132)
|
||||
* [CoreOS](#coreos-stable-899150--beta-101010--alpha-101010)
|
||||
|
||||
### Ubuntu 12.04 LTS
|
||||
Python 2.7.3 should be already on the machine.
|
||||
```
|
||||
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev
|
||||
```
|
||||
|
||||
### Ubuntu 14.04 LTS and BASH on Windows (Build 14362+)
|
||||
Python 2.7.6 should be already on the machine.
|
||||
```
|
||||
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev
|
||||
```
|
||||
|
||||
### Ubuntu 15.10
|
||||
Python 2.7.10 should be already on the machine.
|
||||
```
|
||||
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev build-essential
|
||||
```
|
||||
|
||||
### Ubuntu 16.04 LTS
|
||||
Python 2.7.11 should be already on the machine.
|
||||
```
|
||||
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev build-essential
|
||||
```
|
||||
|
||||
### Debian 7
|
||||
Python 2.7.3 should be already on the machine.
|
||||
```
|
||||
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev
|
||||
```
|
||||
|
||||
### Debian 8
|
||||
Python 2.7.9 should be already on the machine.
|
||||
```
|
||||
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev build-essential
|
||||
```
|
||||
|
||||
### CentOS 6.5 / 6.6 / 6.7
|
||||
|
||||
Not supported with the default version of Python (2.6.6) on the machine.
|
||||
|
||||
### CentOS 7.1 / 7.2
|
||||
Python 2.7.5 should be already on the machine.
|
||||
```
|
||||
sudo yum check-update; sudo yum install -y gcc libffi-devel python-devel openssl-devel
|
||||
```
|
||||
|
||||
### RedHat RHEL 6.7
|
||||
|
||||
Not supported with the default version of Python (2.6.6) on the machine.
|
||||
|
||||
### RedHat RHEL 7.2
|
||||
Python 2.7.5 should be already on the machine.
|
||||
```
|
||||
sudo yum check-update; sudo yum install -y gcc libffi-devel python-devel openssl-devel
|
||||
```
|
||||
|
||||
### SUSE OpenSUSE 13.2
|
||||
Python 2.7.8 should be already on the machine.
|
||||
```
|
||||
sudo zypper refresh && sudo zypper --non-interactive install gcc libffi-devel python-devel openssl-devel
|
||||
```
|
||||
|
||||
### CoreOS Stable-899.15.0 / Beta-1010.1.0 / Alpha-1010.1.0
|
||||
|
||||
Python is not installed by default.
|
|
@ -0,0 +1,146 @@
|
|||
Install Troubleshooting
|
||||
=======================
|
||||
|
||||
Before posting an issue, please review our list of [common issues](https://github.com/Azure/azure-cli/issues?q=label%3AFAQ+is%3Aclosed).
|
||||
|
||||
These are issues we have closed because we cannot address them within the CLI due to platform or language limitations.
|
||||
|
||||
|
||||
Upgrade from 0.1.0b10 causes 'KeyError: Azure' error
|
||||
----------------------------------------------------
|
||||
|
||||
On Python 2, it's recommended to upgrade with the `--ignore-installed` flag:
|
||||
`pip install --upgrade --ignore-installed azure-cli`.
|
||||
|
||||
Alternatively, use the interactive install script.
|
||||
|
||||
See [#1540](https://github.com/Azure/azure-cli/issues/1540#issue-195125878)
|
||||
|
||||
|
||||
Error: 'Could not find a version that satisfies the requirement azure-cli'
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
The error message from pip usually means a very old version of pip is installed.
|
||||
Run `pip --version` to confirm. [Latest pip version](https://pip.pypa.io/en/stable/news/)
|
||||
|
||||
Upgrade `pip` with ``$ pip install --upgrade pip`` or install with the ``--pre`` flag.
|
||||
|
||||
See [#1308](https://github.com/Azure/azure-cli/issues/1308#issuecomment-260413613)
|
||||
|
||||
|
||||
'X509' object has no attribute '_x509'
|
||||
--------------------------------------
|
||||
|
||||
If you run into an ``AttributeError: 'X509' object has no attribute '_x509'`` error, downgrade your version of the requests library from 2.12.1 to 2.11.1.
|
||||
|
||||
See [#1360](https://github.com/Azure/azure-cli/issues/1360)
|
||||
|
||||
|
||||
Windows - 'FileNotFoundError' error on install
|
||||
----------------------------------------------
|
||||
|
||||
Verify that the file path quoted in the error has more than 260 characters.
|
||||
|
||||
If so, the installation files exceed the 260 character limit for file paths on Windows.
|
||||
|
||||
This can be resolved by installing the CLI in a higher directory to prevent reaching the Windows max filepath length.
|
||||
|
||||
See [#1221](https://github.com/Azure/azure-cli/issues/1221#issuecomment-258290204)
|
||||
|
||||
|
||||
Ubuntu 12.04 LTS - Known warning
|
||||
--------------------------------
|
||||
|
||||
You may see the following warning message during install and execution of `az`.
|
||||
```
|
||||
/usr/local/az/envs/default/local/lib/python2.7/site-packages/pip/pep425tags.py:30: RuntimeWarning: invalid Python installation: unable to open /usr/az/envs/default/lib/python2.7/config/Makefile (No such file or directory)
|
||||
warnings.warn("{0}".format(e), RuntimeWarning)
|
||||
```
|
||||
|
||||
See [#348](https://github.com/Azure/azure-cli/issues/348)
|
||||
|
||||
See also [pypa/pip#1074](https://github.com/pypa/pip/issues/1074)
|
||||
|
||||
|
||||
Errors with curl redirection
|
||||
----------------------------
|
||||
|
||||
If you get an error with the curl command regarding the `-L` parameter or an error saying `Object Moved`, try using the full url instead of the aka.ms url:
|
||||
```shell
|
||||
# If you see this:
|
||||
$ curl -L https://aka.ms/InstallAzureCli | bash
|
||||
% Total % Received % Xferd Average Speed Time Time Time Current
|
||||
Dload Upload Total Spent Left Speed
|
||||
100 175 100 175 0 0 562 0 --:--:-- --:--:-- --:--:-- 560
|
||||
bash: line 1: syntax error near unexpected token `<'
|
||||
'ash: line 1: `<html><head><title>Object moved</title></head><body>
|
||||
|
||||
# Try this instead:
|
||||
$ curl https://azurecliprod.blob.core.windows.net/install | bash
|
||||
```
|
||||
|
||||
|
||||
Errors on install with cffi or cryptography
|
||||
-------------------------------------------
|
||||
|
||||
If you get errors on install on **OS X**, upgrade pip by typing:
|
||||
|
||||
```shell
|
||||
pip install --upgrade --force-reinstall pip
|
||||
```
|
||||
|
||||
If you get errors on install on **Debian or Ubuntu** such as the examples below,
|
||||
install libssl-dev and libffi-dev by typing:
|
||||
|
||||
```shell
|
||||
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev
|
||||
```
|
||||
|
||||
Also install Python Dev for your version of Python.
|
||||
|
||||
Python 2:
|
||||
|
||||
```shell
|
||||
sudo apt-get install -y python-dev
|
||||
```
|
||||
|
||||
Python 3:
|
||||
|
||||
```shell
|
||||
sudo apt-get install -y python3-dev
|
||||
```
|
||||
|
||||
Ubuntu 15 may require `build-essential` also:
|
||||
|
||||
```shell
|
||||
sudo apt-get install -y build-essential
|
||||
```
|
||||
|
||||
**Example Errors**
|
||||
|
||||
```shell
|
||||
|
||||
Downloading cffi-1.5.2.tar.gz (388kB)
|
||||
100% |################################| 389kB 3.9MB/s
|
||||
Complete output from command python setup.py egg_info:
|
||||
|
||||
No working compiler found, or bogus compiler options
|
||||
passed to the compiler from Python's distutils module.
|
||||
See the error messages above.
|
||||
(If they are about -mno-fused-madd and you are on OS/X 10.8,
|
||||
see http://stackoverflow.com/questions/22313407/ .)
|
||||
|
||||
----------------------------------------
|
||||
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-77i2fido/cffi/
|
||||
```
|
||||
|
||||
```shell
|
||||
#include <openssl/e_os2.h>
|
||||
^
|
||||
compilation terminated.
|
||||
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
|
||||
|
||||
Failed building wheel for cryptography
|
||||
```
|
||||
|
||||
See Stack Overflow question - [Failed to install Python Cryptography package with PIP and setup.py](http://stackoverflow.com/questions/22073516/failed-to-install-python-cryptography-package-with-pip-and-setup-py)
|
|
@ -1,26 +0,0 @@
|
|||
Installing Nightly Builds
|
||||
=========================
|
||||
|
||||
Try out our latest bits with our nightly builds!
|
||||
|
||||
Install via pip with:
|
||||
|
||||
```shell
|
||||
pip install --pre azure-cli --extra-index-url https://azureclinightly.blob.core.windows.net/packages
|
||||
```
|
||||
|
||||
- Builds happen at 21:00:00 PDT each night.
|
||||
They are published shortly afterwards.
|
||||
|
||||
- Whilst all command modules are built each nightly, not all are are included on install.
|
||||
Install additional components with:
|
||||
```shell
|
||||
export AZURE_COMPONENT_PACKAGE_INDEX_URL=https://azureclinightly.blob.core.windows.net/packages
|
||||
az component update --add <component_name> --private
|
||||
```
|
||||
To view the list of installed packages, run `az component list`.
|
||||
|
||||
- There is no cURL install link available for nightly builds.
|
||||
We recommend creating a virtual environment and running the `pip` command above.
|
||||
|
||||
- [Creating a virtual environment](http://docs.python-guide.org/en/latest/dev/virtualenvs/)
|
|
@ -1,250 +0,0 @@
|
|||
Preview Install Guide
|
||||
========================================
|
||||
|
||||
Looking to get started with Project Az?
|
||||
|
||||
Click on your OS for steps:
|
||||
|
||||
* [OS X](#os-x)
|
||||
* Ubuntu
|
||||
* [12.04 LTS](#ubuntu-1204-lts)
|
||||
* [14.04 LTS](#ubuntu-1404-lts-and-bash-on-windows-build-14362)
|
||||
* [15.10](#ubuntu-1510)
|
||||
* [16.04 LTS](#ubuntu-1604-lts)
|
||||
* Debian
|
||||
* [7](#debian-7)
|
||||
* [8](#debian-8)
|
||||
* CentOS
|
||||
* [6.5 - 6.7](#centos-65--66--67)
|
||||
* [7.1 - 7.2](#centos-71--72)
|
||||
* RHEL
|
||||
* [6.7](#redhat-rhel-67)
|
||||
* [7.2](#redhat-rhel-72)
|
||||
* [SUSE](#suse-opensuse-132)
|
||||
* [CoreOS](#coreos-stable-899150--beta-101010--alpha-101010)
|
||||
* [Docker](#docker)
|
||||
* Windows
|
||||
* [Command Prompt / cmd](#windows-cmd)
|
||||
* [Bash on Windows](#ubuntu-1404-lts-and-bash-on-windows-build-14362)
|
||||
* Python/PIP
|
||||
* [Developer Setup](https://github.com/Azure/azure-cli/blob/master/doc/configuring_your_machine.md)
|
||||
* [Installation troubleshooting](#installation-troubleshooting)
|
||||
|
||||
# Instructions per Platform and Version
|
||||
|
||||
## OS X
|
||||
```
|
||||
curl -L https://aka.ms/InstallAzureCli | bash
|
||||
```
|
||||
|
||||
## Ubuntu 12.04 LTS
|
||||
On a fresh Ubuntu 12.04 VM, install the CLI by executing the following.
|
||||
Python 2.7.3 should be already on the machine.
|
||||
|
||||
```
|
||||
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev
|
||||
curl -L https://aka.ms/InstallAzureCli | bash
|
||||
```
|
||||
|
||||
**Known warnings**
|
||||
Warning 1:
|
||||
You may see the following warning message during install and execution of `az`.
|
||||
```
|
||||
/usr/local/az/envs/default/local/lib/python2.7/site-packages/pip/pep425tags.py:30: RuntimeWarning: invalid Python installation: unable to open /usr/az/envs/default/lib/python2.7/config/Makefile (No such file or directory)
|
||||
warnings.warn("{0}".format(e), RuntimeWarning)
|
||||
```
|
||||
See also https://github.com/pypa/pip/issues/1074.
|
||||
|
||||
## Ubuntu 14.04 LTS and BASH on Windows (Build 14362+)
|
||||
Python 2.7.6 should be already on the machine.
|
||||
|
||||
```
|
||||
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev
|
||||
curl -L https://aka.ms/InstallAzureCli | bash
|
||||
```
|
||||
|
||||
## Ubuntu 15.10
|
||||
Python 2.7.10 should be already on the machine.
|
||||
```
|
||||
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev build-essential
|
||||
curl -L https://aka.ms/InstallAzureCli | bash
|
||||
```
|
||||
|
||||
## Ubuntu 16.04 LTS
|
||||
Python 2.7.11 should be already on the machine.
|
||||
```
|
||||
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev build-essential
|
||||
curl -L https://aka.ms/InstallAzureCli | bash
|
||||
```
|
||||
|
||||
## Debian 7
|
||||
Python 2.7.3 should be already on the machine.
|
||||
```
|
||||
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev
|
||||
curl -L https://aka.ms/InstallAzureCli | bash
|
||||
```
|
||||
|
||||
## Debian 8
|
||||
Python 2.7.9 should be already on the machine.
|
||||
```
|
||||
sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev build-essential
|
||||
curl -L https://aka.ms/InstallAzureCli | bash
|
||||
```
|
||||
|
||||
## CentOS 6.5 / 6.6 / 6.7
|
||||
|
||||
Not supported with the default version of Python (2.6.6) on the machine. We recommend using [Docker](#docker) to access the CLI on this platform.
|
||||
|
||||
## CentOS 7.1 / 7.2
|
||||
Python 2.7.5 should be already on the machine.
|
||||
```
|
||||
sudo yum check-update; sudo yum install -y gcc libffi-devel python-devel openssl-devel
|
||||
curl -L https://aka.ms/InstallAzureCli | bash
|
||||
```
|
||||
|
||||
## RedHat RHEL 6.7
|
||||
|
||||
Not supported with the default version of Python (2.6.6) on the machine. We recommend using [Docker](#docker) to access the CLI on this platform.
|
||||
|
||||
## RedHat RHEL 7.2
|
||||
Python 2.7.5 should be already on the machine.
|
||||
```
|
||||
sudo yum check-update; sudo yum install -y gcc libffi-devel python-devel openssl-devel
|
||||
curl -L https://aka.ms/InstallAzureCli | bash
|
||||
```
|
||||
|
||||
## SUSE OpenSUSE 13.2
|
||||
Python 2.7.8 should be already on the machine.
|
||||
```
|
||||
sudo zypper refresh && sudo zypper --non-interactive install gcc libffi-devel python-devel openssl-devel
|
||||
curl -L https://aka.ms/InstallAzureCli | bash
|
||||
```
|
||||
|
||||
## CoreOS Stable-899.15.0 / Beta-1010.1.0 / Alpha-1010.1.0
|
||||
|
||||
Doesn't have python installed by default and is not currently supported. We recommend using [Docker](#docker) to access the CLI on this platform.
|
||||
|
||||
## Docker
|
||||
|
||||
> Note that our docker images contain the latest code from the master branch.
|
||||
|
||||
Run
|
||||
```shell
|
||||
docker run -it azuresdk/azure-cli-python:latest bash`
|
||||
```
|
||||
|
||||
## Windows (cmd)
|
||||
|
||||
The CLI is available for Windows though PIP using the steps below. If you do not have Python/PIP installed, consider using [Docker](#docker) to access the CLI.
|
||||
|
||||
#### Step 1: Install Python 3.5.x
|
||||
|
||||
If Python 2.7, 3.4 or 3.5 is already installed, skip to step 2.
|
||||
|
||||
Visit the Python site and [download Python 3.5](https://www.python.org/downloads/release/python-352/) for your OS.
|
||||
> **NOTE**: We recommend checking the "Add Python 3.5 to PATH" option during install.
|
||||
Once the install is complete, if you open a new command prompt, you should test your Python installation:
|
||||
|
||||
```shell
|
||||
C:\temp> python --version
|
||||
Python 3.5.2
|
||||
```
|
||||
|
||||
#### Step 2: Install Azure CLI using PIP
|
||||
|
||||
Run the following from a command prompt to install the Azure CLI 2.0 using the Python package manager, PIP:
|
||||
|
||||
```shell
|
||||
C:\temp> pip install azure-cli
|
||||
```
|
||||
|
||||
And after the installation complete, you can run the Azure CLI 2.0 from the command prompt:
|
||||
|
||||
```shell
|
||||
C:\temp> az
|
||||
```
|
||||
|
||||
Installation Troubleshooting
|
||||
----------------------------
|
||||
|
||||
**Errors with curl redirection**
|
||||
|
||||
If you get an error with the curl command regarding the `-L` parameter or an error saying `Object Moved`, try using the full url instead of the aka.ms url:
|
||||
```shell
|
||||
# If you see this:
|
||||
$ curl -L https://aka.ms/InstallAzureCli | bash
|
||||
% Total % Received % Xferd Average Speed Time Time Time Current
|
||||
Dload Upload Total Spent Left Speed
|
||||
100 175 100 175 0 0 562 0 --:--:-- --:--:-- --:--:-- 560
|
||||
bash: line 1: syntax error near unexpected token `<'
|
||||
'ash: line 1: `<html><head><title>Object moved</title></head><body>
|
||||
|
||||
# Try this instead:
|
||||
$ curl https://azurecliprod.blob.core.windows.net/install | bash
|
||||
```
|
||||
|
||||
|
||||
**Errors on install with cffi or cryptography:**
|
||||
|
||||
If you get errors on install on **OS X**, upgrade pip by typing:
|
||||
|
||||
```shell
|
||||
pip install --upgrade --force-reinstall pip
|
||||
```
|
||||
|
||||
If you get errors on install on **Debian or Ubuntu** such as the examples below,
|
||||
install libssl-dev and libffi-dev by typing:
|
||||
|
||||
```shell
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libssl-dev libffi-dev
|
||||
```
|
||||
|
||||
Also install Python Dev for your version of Python.
|
||||
|
||||
Python 2:
|
||||
|
||||
```shell
|
||||
sudo apt-get install -y python-dev
|
||||
```
|
||||
|
||||
Python 3:
|
||||
|
||||
```shell
|
||||
sudo apt-get install -y python3-dev
|
||||
```
|
||||
|
||||
Ubuntu 15 may require `build-essential` also:
|
||||
|
||||
```shell
|
||||
sudo apt-get install -y build-essential
|
||||
```
|
||||
|
||||
**Example Errors**
|
||||
|
||||
```shell
|
||||
|
||||
Downloading cffi-1.5.2.tar.gz (388kB)
|
||||
100% |################################| 389kB 3.9MB/s
|
||||
Complete output from command python setup.py egg_info:
|
||||
|
||||
No working compiler found, or bogus compiler options
|
||||
passed to the compiler from Python's distutils module.
|
||||
See the error messages above.
|
||||
(If they are about -mno-fused-madd and you are on OS/X 10.8,
|
||||
see http://stackoverflow.com/questions/22313407/ .)
|
||||
|
||||
----------------------------------------
|
||||
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-77i2fido/cffi/
|
||||
```
|
||||
|
||||
```shell
|
||||
#include <openssl/e_os2.h>
|
||||
^
|
||||
compilation terminated.
|
||||
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
|
||||
|
||||
Failed building wheel for cryptography
|
||||
```
|
||||
|
||||
See Stack Overflow question - [Failed to install Python Cryptography package with PIP and setup.py](http://stackoverflow.com/questions/22073516/failed-to-install-python-cryptography-package-with-pip-and-setup-py)
|
|
@ -42,7 +42,7 @@ using NPM, upgrade with `npm upgrade -g azure-cli`. If you used an installer,
|
|||
we recommend downloading the latest installer to upgrade.
|
||||
|
||||
To install the Azure CLI 2.0, follow the steps for your preferred platform or
|
||||
environment on our [Installation Guide](https://github.com/Azure/azure-cli/blob/master/doc/preview_install_guide.md).
|
||||
environment on our [Installation Guide](https://github.com/Azure/azure-cli/blob/master/README.rst#installation).
|
||||
|
||||
Once installed, you can run `az configure` and follow the steps to setup your default output format.
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче