You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/05/27 12:55:19 UTC

[GitHub] [airflow] JavierLopezT edited a comment on issue #15572: import error

JavierLopezT edited a comment on issue #15572:
URL: https://github.com/apache/airflow/issues/15572#issuecomment-849542122


   > @zorzigio
   > I'm use airflow helm chart and image info is below
   > 
   > ```
   > image:
   >     repository: apache/airflow
   >     tag: 2.0.2-python3.8
   > ```
   > 
   > I add just `PYTHONPATH` to config env
   > 
   > ```
   > #values.yaml
   > airflow:
   >   config:
   >     PYTHONPATH: /opt/airflow/dags/repo # repo is created because of gitsync 
   > ```
   > 
   > then import error is gone 👍👍
   > my dags folder tree
   > 
   > ```
   > dags
   >   ㄴ __init__.py
   >   ㄴ example.py
   >   ㄴ utils
   >     ㄴ decorator.py
   >   ㄴ category_1
   >     ㄴ file_1.py
   >     ㄴ file_2.py
   > ```
   > 
   > now I can `from dags import some_function` in file_1 and file_2
   > Also I can `from dags.utils.decorator import some` in example.py
   > 😁
   
   Do you know how could I "translate" your solution to a docker-compose? Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org