Open In App
Related Articles

How to Install cx_oracle in Python on Linux?

Improve Article
Improve
Save Article
Save
Like Article
Like

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:

Installing cx_oracle Package on Linux using Conda:

If you want the installation to be done through conda, you can use the below command:

conda install cx_oracle

Type in “y” for yes when prompted.

You will get a similar message once the installation is complete

Installing cx_oracle Package on Linux using Conda

Make sure you follow the best practices for installation using conda as:

  • Use an environment for installation rather than in the base environment using the below command:
conda create -n my-env
conda activate my-env

Note: If your preferred method of installation is conda-forge, use the below command:

conda config --env --add channels conda-forge

Verifying cx_oracle Package Installation on Linux using Conda:

Use the below command to verify if the above package has successfully installed:

conda list cx_oracle

You will get a similar message as shown below if the installation has been successful:

Verifying cx_oracle Package Installation on Linux using Conda

Installing cx_oracle Package on Linux using PIP:

Users who prefer to use pip can use the below command to install the package:

pip install cx_oracle

You will get a similar message once the installation is complete:

Installing cx_oracle Package on Linux using PIP

It is a good programming practice to install packages in a virtual environment rather than installing them globally. PIP users can use the below command to create a virtual environment:

python3 -m venv my-env

Activate the virtual environment (ie, my-env) using the below command:

source my-env/bin/activate

Verifying cx_oracle Package Installation on Linux using PIP:

Use the below command to check if the package has been successfully installed:

python3 -m pip show cx_oracle

You will get a similar message as shown below if the installation is successful:

Verifying cx_oracle Package Installation on Linux using PIP

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 30 Sep, 2021
Like Article
Save Article
Previous
Next
Similar Reads
Complete Tutorials