No module named 'psycopg2'

0

Despite this being one of only two pre-installed Python modules (https://docs.aws.amazon.com/mwaa/latest/userguide/working-dags-dependencies.html), I'm getting this error (No module named 'psycopg2') with a test DAG. It's from the following import:
from airflow.operators.postgres_operator import PostgresOperator

This service isn't listed in the Support Ticket drop-down yet, so I'm hoping somebody here might have an idea!

BTW, I don't think these submodules should have an impact on the availability of psycopg2, but here's my requirements.txt file.

(All in the form "apache-airflow bracket submodule bracket", reformatted for this post)
amazon
postgres
mysql
docker
slack
crypto

Thanks for your time,
Tim

Edited by: TKnight-HG on Dec 1, 2020 11:21 AM

Edited by: TKnight-HG on Dec 1, 2020 11:23 AM

asked 3 years ago1537 views
4 Answers
0

My requirements.txt file contained an error on the "postgres" Extra package (a space was inside the bracket). Fixing that line and properly updating the environment to point to the new version of the file solved the problem.

answered 3 years ago
0

We have followed the troubleshooting guide and are still receiving the same error. Are there any other resources we can reference in order to resolve this issue?

k-af
answered 3 years ago
0

Hi!

If any of your requirements fail, then the rest will quit loading. There will be better logging in the near future, however in the interim please try removing apache-airflow bracket crypto bracket from the list as it looks like that is the one that is failing.

Thanks!

Edited by: JohnJ-AWS on Jan 6, 2021 1:33 PM

AWS
John_J
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions