# Activate the existing virtual environment
source /opt/flask-app/flask-venv/bin/activate

# Verify the venv and Python version
which python3
python3 -V
read -p "Press ENTER to Continue..."

# Remove the existing PostgreSQL adapter / Install the binary distribution
python3 -m pip uninstall -y psycopg2 psycopg2-binary
python3 -m pip install psycopg2-binary
python3 -m pip show psycopg2-binary

# Verify that Python can actually import it
python3 -c "import psycopg2; print(psycopg2.__version__); print(psycopg2.__file__)"

deactivate
