View a markdown version of this page

Python language support for UDFs - 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.

Python language support for UDFs

You can create a custom UDF based on the Python programming language. The Python 2.7 standard library is available for use in UDFs, with the exception of the following modules:

  • ScrolledText

  • Tix

  • Tkinter

  • tk

  • turtle

  • smtpd

In addition to the Python Standard Library, the following modules are part of the Amazon Redshift implementation:

You can also import your own custom Python modules and make them available for use in UDFs by executing a CREATE LIBRARY command. For more information, see Example: Importing custom Python library modules.

Important

Amazon Redshift blocks all network access and write access to the file system through UDFs.

Note

Python 3 isn’t available for Python UDFs. To get Python 3 support for Amazon Redshift UDFs, use Scalar Lambda UDFs instead.