Adding apache-airflow library to PyCharm

Viewed 693

I've been trying to wrap my head about how can I add apache-airflow library to my virtual env in windows.

  1. Apache-airflow is installed on Linux which is hosted by VirtualBox on my machine.

  2. PyCharm is installed on Windows 10 where I am trying to figure a way how to add that library to my PyCharm(Community Edition).

Basically I want to keep apache-airflow on my virtual machine and develop DAGs and necessary components on my Windows environment.

How can I achieve this? Any help would be appreciated.

1 Answers

If the code is going to be running on the linux VM. Add the python library on the VM. Create a shared folder between your Windows machine and the VM. Save your pycharm project in the shared folder.

This will "work" but have a few significant draw backs:

  1. Pycharm won't have any "code completion" for the imported libraries.
  2. Pycharm will complain that the library doesn't exist.
  3. You will have to test your code either through ssh to the remote machine or in a terminal on the remote machine.

Another option is to just install pycharm in the linux VM, if you are using a linux distro with a desktop, like ubuntu for instance.

If pycharm isn't required, VS Code has a nice plugin for remote development: https://code.visualstudio.com/docs/remote/ssh

Related