Hi sreenivas p
Since you are running this in a Bash shell with Python 3, you should install the missing packaging library first, and then install cx_Oracle.
Step 1: Install the packaging module
Use pip to install the required dependency. For Python 3, you should typically use the pip3 command.
bash
pip3 install packaging
Use code with caution.
Alternative: If the above command fails or you have multiple Python versions, use the following command to ensure the package is installed for the correct Python 3 interpreter.
bash
python3 -m pip install packaging
Use code with caution.
Step 2: Install cx_Oracle
After installing the packaging module, you can proceed with the installation of cx_Oracle.
Option A: Using pip (Recommended)
If you are connected to the internet, the simplest method is to let pip install cx_Oracle directly from PyPI. pip will handle any further dependencies automatically.
bash
pip3 install cx_Oracle
Use code with caution.
Or, if you need to use the specific version from your downloaded directory:
bash
pip3 install /u01/softwares/cx_Oracle-8.1.0/
Use code with caution.
Option B: Using setup.py (Manual Installation)
If you must install using the setup.py file, you can now run the command from the cx_Oracle-8.1.0 directory, and it should work correctly.
bash
cd /u01/softwares/cx_Oracle-8.1.0/
python3 setup.py install
------------------------------
Anas AlSaleh
IBM Power Systems Software Specialist
Saudi Business Machines ( SBM )
Riyadh
------------------------------
Original Message:
Sent: Thu September 18, 2025 12:06 PM
From: sreenivas p
Subject: Reg ModuleNotFoundError: No module named 'packaging'
Hi Team,
i am unable to install cx_Oracle . i am getting the error as ModuleNotFoundError: No module named 'packaging'
Could you please help me resolve this issue?
bash-5.2$ python3 setup.py build
Traceback (most recent call last):
File "/u01/softwares/cx_Oracle-8.1.0/setup.py", line 12, in <module>
import pkg_resources
File "/usr/opt/python3/lib/python3.9/site-packages/pkg_resources/__init__.py", line 95, in <module>
import packaging.specifiers
ModuleNotFoundError: No module named 'packaging'
bash-5.2$
------------------------------
sreenivas p
------------------------------