Shell script start Python instance with conda env using macOS Automator

Viewed 188

I try to automate some repetitive terminal commands on startup (OS X).

The internet provides some tweaks for .py-scripts, but not for python instances in a virtual environment. In my case I tried to start Airflow on startup, which is based in a virtual environment (airflow).

Normally I type:

#First Terminal
conda activate airflow
airflow scheduler

#Second Terminal
conda activate airflow
airflow webserver -p 8080

Do you have any solution how to run a macOS Automator script which covers the parameters?

The one liner

/Users/user_name/opt/anaconda3/bin/python conda activate airflow && airflow scheduler

doesn't work in my tries (via AppleScript, Run shell script, ...).

I always get an error like: no such file or directory: activate or *no such file or directory: airflow *

--> struggle by the blanks (airflow scheduler)

0 Answers
Related