Installing OpenStack CLI Tools on Windows

Prerequisites

  • The OpenStack Command-Line Interface (CLI) tools are supported on Python 2.7, so you must have a Python 2.7 environment installed. Download the latest Python 2 release from https://www.python.org/downloads/windows/.
  • Ensure that the C:\Python27\Scripts directory is defined in the PATH environment variable.
  • Next, ensure you have installed the Python package management system, pip. To install it, use the easy_install command from the setuptools package:

    C:>easy_install pip

  • Alternatively, install pip with the unofficial binary installer provided by Christoph Gohlke.
  • Also, it’s best to install the CLI in a virtual environment, so install virtualenv with pip install virtualenv.
  • You need admin rights on the Windows computer you use to run OpenStack CLI commands.
  • If you use Powershell, you want to have Powershell installed and be able to open it using “Run as Administrator.” Alternatively, you can install Git for Windows and use Git Bash which is helpful for sourcing credentials as environment variables, downloaded directly from the dashboard.

These instructions are tested on Windows 10 as a user with administrator privileges.

Using a virtual environment for the installation

  1. Start PowerShell by right-clicking it and choosing Run as Administrator. Or, start Git Bash.
  2. After installing virtualenv with pip install virtualenv, create a virtual environment with this command where {name} is the name of the virtual environment:

    PS C:\Python27> virtualenv {name}

    For example:

     PS C:\Python27> virtualenv openstack-cli
    
  3. To activate the virtual environment, run the activate script:

    PS C:\Python27> .\openstack-cli\Scripts\activate

Now that the virtual environment is active, your prompt changes to indicate the one you are currently using:

(openstack-cli) PS C:\Python27>

Installing the OpenStack client

  1. With the virtual environment active, install the OpenStack client, which in turn installs python-novaclient and the other dependent clients:

    (openstack-cli) PS C:> pip install python-openstackclient

** Note *** You may see errors if there are version mismatches in the underlying dependencies. For example, if you see:

```
error: [WinError 2] The system cannot find the file specified
----------------------------------------
Failed building wheel for netifaces
Running setup.py clean for netifaces
Failed to build PyYAML netifaces
```

You need to find a compatible installation for your system (such as an
unofficial wheel file for [Python 3.5 libraries](http://www.lfd.uci.edu/~gohlke/pythonlibs/),
 search for ``netifaces`` in the list, download, then use the 
 ``pip install`` command with the downloaded file as the argument. For
 example:

```
pip install netifaces-0.10.4-cp35-none-win32.whl
```

Then try pip install python-openstackclient again until you clear up all
dependencies.
  1. Now that the client is installed, you must provide credentials in the environment in order to run commands. Refer to Providing Metacloud Credentials to CLI Tools to continue.