title: How to use requirements.txt file in Airflow's PythonVirtualenvOperator?
body: <p>In <a href="https://github.com/apache/airflow/pull/17349" rel="nofollow noreferrer">Airflow 2.2.3, PythonVirtualenvOperator was updated</a> to allow templated requirements.txt files in the requirements parameter. However, I am unable to properly utilize that parameter. I am seeking guidance on how to properly utilize a requirements.txt file with Airflow's PythonVirtualenvOperator.</p>
  <p>Here's my <code>/dags</code> format:</p>
  <pre><code>dags
  ├── .airflowignore
  ├── daily.py
  └── modules
      └── monday
          ├── monday.py
          └── requirements.txt
  </code></pre>
  <p>In daily.py, I define my daily DAG. The task I'd like to reference requirements.txt for is defined like so:</p>
  <pre><code>@task.virtualenv(requirements='modules/monday/requirements.txt')
  def sync_board_items():
      from modules.monday.monday import sync_board_items
      import logging
      logging.basicConfig(level=logging.INFO)
      sync_board_items(board_id=XXXX, table=XXXX)
  </code></pre>
  <p>This seems to fit the implementation described in GitHub, because requirements is a string, not a list, and it complies with the <code>*.txt</code> template. However, when the task runs, I quickly receive an error:</p>
  <pre><code>Executing cmd: /tmp/venvfn63dy3c/bin/pip install m o d u l e s / m o n d a y / r e q u i r e m e n t s . t x t
  ERROR: Directory '/' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
  </code></pre>
  <p>This seems to indicate that PythonVirtualenvOperator is treating my requirements param like a list instead of a string. In other words, I am doing something wrong and the PythonVirtualenvOperator is not properly handling my requirements.txt file. What am I missing or how can I leverage a requirements.txt file in Airflow's PythonVirtualenvOperator?</p>