1. Introduction
This post gathers information about configuring Python to connect to PostgreSQL database.2. Step-by-Step
2.1. Install Python and Pip on SO Base
2.1.1. ONLY FOR CENTOS 7: Install required packages: Python Pip
# yum install epel-release# cd /tmp
# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum -y update
# yum -y install python-pip
# pip install --upgrade pip
2.1.2. ONLY FOR UBUNTU: Install Python 2.7 and Pip
# sudo apt-get update# sudo apt-get install python2.7
# sudo apt install python-pip
# pip install --upgrade pip
2.2. Install psycopg2
# pip install psycopg22.3. Install pygresql
# pip install pygresql3. Reference
- https://www.liquidweb.com/kb/enable-epel-repository/
- https://www.liquidweb.com/kb/how-to-install-pip-on-centos-7/
- https://wiki.postgresql.org/wiki/Using_psycopg2_with_PostgreSQL
- https://www.a2hosting.com/kb/developer-corner/postgresql/connecting-to-postgresql-using-python
- http://initd.org/psycopg/docs/install.html
Nenhum comentário:
Postar um comentário