File "/app/awssecurityhubcollector/main.py", line 115, in bulkinsert…
- User
File "/app/aws_securityhub_collector/main.py", line 115, in bulk_insert psycopg2.extras.execute_batch(cursor, insert_clause, values) ^^^^^^^^^^^^^^^ AttributeError: module 'psycopg2' has no attribute 'extras'
- Assistant
The error message suggests that the module
psycopg2does not have an attribute namedextras.To resolve this issue, you can try the following steps:
-
Ensure that you have installed the
psycopg2library correctly. You can use the following command to install it:pip install psycopg2. -
If you have already installed
psycopg2, try updating it to the latest version usingpip install --upgrade psycopg2. -
If you are still facing the issue, it is possible that the version of
psycopg2you are using does not have theextrasattribute. In that case, you can try usingpsycopg2.extras.execute_valuesinstead ofpsycopg2.extras.execute_batch, as it provides similar functionality.
-