How to Install cx_oracle in Python on MacOS?
Last Updated :
30 Sep, 2021
In this article, we will learn how to install cx_Oracle in Python on MacOS. The cx_Oracle is a Python extension module that enables access to Oracle Database. It conforms to the Python database API 2.0 specification with a considerable number of additions and a couple of exclusions. See the homepage for a feature list.
Installation:
Method 1: Using pip to install cx_Oracle Package
Follow the below steps to install the cx_Oracle package on macOS using pip:
Step 1: Install the latest Python3 in MacOS
Step 2: Check if pip3 and python3 are correctly installed.
python3 --version
pip3 --version
Step 3: Upgrade your pip to avoid errors during installation.
pip3 install --upgrade pip
Step 4: Enter the following command to install cx_Oracle using pip3.
pip3 install cx_Oracle

Method 2: Using setup.py to install cx_Oracle
Follow the below steps to install the cx_Oracle package on macOS using the setup.py file:
Step 1: Download the latest source package of cx_Oracle for python3 from here.
curl https://files.pythonhosted.org/packages/be/bf/1dc153a103680b0831299e119c2281ecdec93fcfd27dd0a774a79a4f7267/cx_Oracle-8.2.1.tar.gz > cx_Oracle.tar.gz
Step 2: Extract the downloaded package using the following command.
tar -xzvf cx_Oracle.tar.gz
Step 3: Go inside the folder and Enter the following command to install the package.
Note: You must have developer tools for XCode MacOS installed in your system
cd cx_Oracle-8.2.1
python3 setup.py install

Verifying cx_Oracle installation on macOS:
Make the cx_Oracle import in your python terminal to verify if the installation has been done properly:
import cx_Oracle
If there is any error while importing the module then is not installed properly.
Similar Reads
How to Install cx_oracle in Python on Linux? The cx_oracle package is used to connect with the Oracle database using python. In this, article, we will look into the process of installing the cx_oracle package on Linux. Pre-requisites: The only thing that you need for installing Numpy on Windows are: PythonPIP or Conda (Depending upon the user
2 min read
How to Install Packages in Python on MacOS? To get started with using pip, you should install Python on your system. Make sure that you have a working pip. Installing Packages in Python on MacOS: Follow the below steps to install python packages on MacOS: Step 1: As the first step, you should check that you have a working Python with pip inst
2 min read
How to Install pyperclip in Python on MacOS? In this article, we will learn how to install pyperclip in Python on MacOS. Pyperclip is a cross-platform Python module for copy and paste clipboard functions. It works with both Python 2 and 3. This module was created to enable cross-platform copy-pasting in Python which was earlier absent. The pyp
2 min read
How to Install cx_oracle in Python on Windows? The cx_oracle package is used to connect with the Oracle database using python. In this, article, we will look into the process of installing the cx_oracle package on Windows. Pre-requisites: The only thing that you need for installing the Scrapy module on Windows are: Python PIP or Conda (depending
2 min read
How to Install Nose in Python on MacOS? In this article, we will learn how to install Nose in Python on MacOS. Nose extends the test loading and running features of unittest, making it easier to write, find and run tests. Installation:Method 1: Using pip to install Nose Package Follow the below steps to install the Nose package on macOS u
2 min read