0

I'm using Composer version 1.2.0-1.9.0, and I'm trying to use a MsSqlOperator in one of my DAGs. However, when published, Airflow gave me the error: No module named 'pymssql'.

Now, I could install it as a PyPi package, but shouldn't it be supported natively? Even if not, can't I include the mssql subpackage when creating an environment?

Lucas Rosa
  • 33
  • 4

1 Answers1

1

If you want to add additional packages which are not part of the base environment, in the Cloud Composer console, when clicking on your environments name you have a tab named PYPI PACKAGES. There you can specify the Python package and version you would like to add to your environment.

You can also do it programmatically by creating a requirements.txt file indicating the additional packages you want and pass it to your Composer environment using the gcloud commands. The needed gcloud command is the one below.

gcloud composer environments update ENVIRONMENT-NAME \
--update-pypi-packages-from-file requirements.txt \
--location LOCATION
Atybzz
  • 327
  • 3
  • 14