View a markdown version of this page

Importing the Python connector - Amazon Redshift

Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026. We will start enforcing it in phases. For more information on the details of Python end of life and migration options, see the blog post that was published on June 30, 2025.

Importing the Python connector

To import the Python connector, run the following command.

>>> import redshift_connector

To connect to an Amazon Redshift cluster using AWS credentials, run the following command.

conn = redshift_connector.connect( host='examplecluster.abc123xyz789.us-west-1.redshift.amazonaws.com', port=5439, database='dev', user='awsuser', password='my_password' )