Instead of using the installation methods described in the Quickstart
or using the OCI CLI Container image, you can
manually install the CLI and its dependencies using pip. Before
proceeding, be sure you meet the Requirements.
Prior to manually installing the CLI:
Make sure your Python path is set correctly
Run "python --version" or "python3 --version" and make sure you have the
required version
If installing on Oracle Linux or CentOS, have the following installed:
gcc
zlib-devel
python3-devel
the latest version of OpenSSL 1.1.1
Note
You can also download the CLI installation
files and perform an offline installation.
Some versions of Oracle Linux come with incompatible versions of Python, and might require additional components to install the CLI. Before installing the CLI, run the following commands on a new Oracle Linux image.
Tip
The CLI is installed by default on Oracle Linux 9, Oracle Autonomous Linux versions 7 and 8 and Oracle Linux Cloud Developer 8.
Oracle Linux 8
sudo dnf -y update
sudo dnf -y groupinstall "Development Tools"
sudo dnf -y install gcc wget openssl-devel bzip2-devel libffi-devel
sudo dnf -y module enable python36 # for Oracle Linux 8
sudo dnf -y install python36 # for Oracle Linux 8
For Oracle Linux 7, note that python3-devel is in the
ol7_optional_latest repository which may not be enabled by
default. To install python3-devel, run the following from a shell
prompt:
Step 2: Creating and Configuring a Virtual Environment 🔗
The venv Python module is a virtual environment builder that lets you create isolated Python environments. We recommend installing the CLI in a virtual environment.
Installing and Activating your Virtual Environment 🔗
After Python is installed, set up a virtual environment for your operating system using the following steps.
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
Validating the Release Checksum 🔗
After the CLI package is downloaded, you can validate the SHA-256 checksum. Depending
on your operating system, use the following instructions to compare the SHA-256
value provided in Github release with the value you get when completing this
procedure for your operating system.
Windows
Open a command shell.
Change to the directory where the download file is located.
Run the following command to generate the checksum value, where
filename is the name of the downloaded file on your
computer:
certutil -hashfile filename SHA256
Verify that the returned checksum value matches the SHA-256 value provided
in the Github release. If the values do not match, please download the file
again and repeat this procedure.
Mac OS
Open a terminal window.
Run the following command, where fileLocation is the full
path of the file on your
computer:
shasum -a 256 fileLocation
This
command should return a checksum value.
Verify that the returned checksum value matches the SHA-256 value provided
in the Github release. If the values do not match, please download the file
again and repeat this procedure.
Linux
Open a terminal session.
Run the following command, where fileLocation is the full
path of the file on your
computer:
sha256sum fileLocation
This
command should return a checksum value.
Verify that the returned checksum value matches the SHA-256 value provided
in the Github release. If the values do not match, please download the file
again and repeat this procedure.