The OpenStack Command-line Interface (CLI) tools are supported on Python 2.7. While Mac OS X comes with Python 2.7, it is ideal to use a virtual environment so that your work is isolated and you can control the tool versions.
To prepare your OS X environment, you need to install the following tools:
- Xcode Command Line Tools—supports the use of Homebrew and other tools.
- Homebrew—to install Python and other packages. Instructions for proper setup can be found in the Hitchhiker’s Guide to Python.
- Virtualenv—install and create virtual environments. Read more in the Hitchhiker’s Guide to Python about Virtual Environments.
Using a Virtual Environment for the Installation
- Start the Terminal application.
- Change to your project directory.
Create a virtual environment.
$ virtualenv <virtualenv_name>
Activate the virtual environment.
$ source <virtualenv_name>/bin/activate
Now that the virtual environment is active, your prompt changes to indicate the virtual environment you are currently using:
If you are using a conda system, like Anaconda or Miniconda, you should use the environment management system provided by conda.
Installing the OpenStack Client
With the virtual environment active, install the OpenStack client, which in turn installs python-novaclient and the other dependent clients:
(virtualenv_name) $ pip install python-openstackclient
Follow the instructions in Providing Metacloud Credentials to CLI Tools to begin performing OpenStack commands.