Home > Software engineering >  How do I import Apache Airflow into Intellij?
How do I import Apache Airflow into Intellij?

Time:02-12

So I'm trying to get my Intellij to see Apache Airflow that I downloaded. The steps I've taken so far: I've downloaded the most recent Apache Airflow setup and saved the apache airflow 2.2.3 onto my desktop. I'm trying to get it to work with my Intellij, I've tried adding the Apache Airflow folder into the Library and Modules, both have come back with errors stating it's not being utilized. I've tried looking up documentation on it within Airflow but I'm not able to find any documentation on how to implement in your own IDE to write Python scripts for DAGs and other items?

How would I go about doing this as I'm at a complete loss of how to get Intellij to register that Apache Airflow is a Library to utilize for Python code so I can write DAG files correctly within the IDE itself.

Any help would be much appreciated as I've been stuck on this aspect for the past couple of days searching for any kind of documentation to make this work.

CodePudding user response:

Airflow is both application and library. In your case you are not trying to run the application but only looking to write DAGs so you need it just as a library. You should just open a virtual environment (preferably) and run:

pip install apache-airflow

Then you can write DAGs using the library and Intellij will let you know if you are using wrong imports or deprecated objects.

When your DAG file is ready deploy it to the DAG folder on the machine where Airflow is running.

  • Related