There could be different issues related to importing psycopg2 in AWS Glue, but one common issue is that the required psycopg2 library might not be available in Glue's default Python environment. Glue provides a pre-installed Python environment with some commonly used libraries, but psycopg2 might not be included.
To resolve this issue, you can create a custom Python environment with psycopg2 and other required libraries and use it in your Glue job. You can create a conda environment with the required packages and upload it to S3, or you can use a Docker container with the required dependencies. Additionally, you might need to specify the custom environment in the Glue job's configuration settings.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-02-04 11:00:00 +0000
Seen: 11 times
Last updated: Jul 12 '21
How can popen() be used to direct streaming data to TAR?
In Python, can a string be utilized to retrieve a dataframe that has the same name as the string?
What is the method for merging field value and text into a singular line for display?
What is the method for programmatic access to a time series?