Skip to content

Commit

Permalink
error early if virtualenv is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
MatrixManAtYrService committed Aug 1, 2021
1 parent e8fc3ac commit 7bc1336
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions airflow/operators/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import inspect
import os
import pickle
import shutil
import sys
import types
import warnings
Expand Down Expand Up @@ -325,6 +326,8 @@ def __init__(
"Passing op_args or op_kwargs is not supported across different Python "
"major versions for PythonVirtualenvOperator. Please use string_args."
)
if not shutil.which("virtualenv"):
raise AirflowException('PythonVirtualenvOperator requires virtualenv, please install it.')
super().__init__(
python_callable=python_callable,
op_args=op_args,
Expand Down

0 comments on commit 7bc1336

Please sign in to comment.