diff --git a/charmcraft/dispatch.py b/charmcraft/dispatch.py index 6222bd0aa..cd02457b9 100644 --- a/charmcraft/dispatch.py +++ b/charmcraft/dispatch.py @@ -24,8 +24,10 @@ DISPATCH_SCRIPT_TEMPLATE = """\ #!/bin/sh dispatch_path="$(dirname $(realpath $0))" -python_path="${{dispatch_path}}/venv/bin/python" +venv_bin_path="${{dispatch_path}}/venv/bin" +python_path="${{venv_bin_path}}/python" if [ ! -e "${{python_path}}" ]; then + mkdir -p "{{venv_bin_path}}" ln -s $(which python3) "${{python_path}}" fi