Oracle Cloud Infrastructure Documentation

Manual Installation

Instead of using the installer script as described in the Quickstart, you can manually install the CLI and its dependencies. Before proceeding, be sure you meet the Requirements.

Warning

Oracle recommends that you avoid using string values that include confidential information.

Step 1: Installing Python

Python installation instructions vary for each operating system.

Windows and Windows Server 2008 R2
Oracle Linux 7.3 and Oracle Linux 6
CentOS 6 and CentOS 7
Ubuntu 16.04

Step 2: Installing and Configuring virtualenv

virtualenv is a virtual environment builder that lets you create isolated Python environments. For Linux users, virtualenv is usually in a separate package from the main Python package.

Download the software and documentation from:

Installing and Configuring virtualenv

After Python is installed, install and configure virtualenv.

  1. To set up the environment for Python 2, use the following command.

    pip install virtualenv
  2. To set up the environment for Python 3, use the following command.

    pip3 install virtualenv
  3. virtualenv typically installs to your Python directory. For example:

    /usr/local/share/python3/virtualenv
  4. (Optional) To create a directory for storing your virtual environments, run the following command.

    mkdir -p myvirtualspaces/virtualenvs
  5. To create a new virtual environment without any packages, run the following command.

    virtualenv myvirtualspaces/virtualenvs/cli-testing --no-site-packages

If you're installing a newer version of Python to run alongside an existing version, you can create a virtual environment that uses the new version.

To reference the new version of Python, run the following command with the -p parameter.

virtualenv -p /usr/local/bin/python3.6 cli-testing

Step 3: Installing the Command Line Interface

You can download the CLI from GitHub or install the package from Python Package Index (PyPI).

To install using the GitHub download:

  • Download and unzip oci-cli.zip.
  • Run the following command.

    pip install oci_cli-*-py2.py3-none-any.whl

To install using PyPI, run the following command.

pip install oci-cli

For information on how to start a CLI session, see Starting a CLI Session.

Installing Without a Virtual Environment

We do not recommend installing the CLI in your system-wide Python and suggest that instead you install the CLI using the installer or virtual environment.

In cases where you are trying to install the CLI in your system-wide Python using the latest pip version, you might encounter conflicts with some distutils installed packages. Following is an example error message when this occurs:

sudo pip install oci-cli
...
...
Cannot uninstall 'requests'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Another option is to install the CLI for the user using the following command, although this approach is not supported:

pip install --user oci-cli