Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I install extra packages from the code editor #48

Open
ash-lyrid opened this issue Jun 29, 2022 · 1 comment
Open

How do I install extra packages from the code editor #48

ash-lyrid opened this issue Jun 29, 2022 · 1 comment
Labels
question Further information is requested

Comments

@ash-lyrid
Copy link

Hi Team,

Is there a way we could install some dependent packages of the Dags which are hosted on PyPi via code editor. Maybe running requirements.txt file programatically/ button?

Thanks

@andreax79
Copy link
Owner

You can install the requirements creating (and starting manually) a dag like the following:

from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.utils.dates import days_ago

dag = DAG(
dag_id='update-requirements',
schedule_interval=None,
start_date=days_ago(1)
)

pip_install_requirements = BashOperator(
task_id='pip_install_requirements ',
bash_command="pip install -r requirements.txt",
dag=dag
)

if name == "main":
dag.cli()

@andreax79 andreax79 added the question Further information is requested label Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants