full-stack-fastapi-template icon indicating copy to clipboard operation
full-stack-fastapi-template copied to clipboard

🔧 Run task by the same Python environment used to run Copier

Open waketzheng opened this issue 10 months ago • 1 comments

My development environment is MacOS with default Python version 2.7, and I got the following error when running copier:

 > Running task 1 of 1: python .copier/update_dotenv.py
  File ".copier/update_dotenv.py", line 16
    if line.startswith(f"{upper_key}="):
                                     ^
SyntaxError: invalid syntax

How to reproduce:

alias python=python2
copier copy https://github.com/tiangolo/full-stack-fastapi-template my-awesome-project --trust

As the copier document says: we can use "{{ _copier_python }}" to run script by the same Python environment used to run Copier.

waketzheng avatar Apr 07 '24 09:04 waketzheng

I needed this on an Ubuntu system that does not have /usr/bin/python at all (need to use python3) - thank you for the fix!

tuukka avatar Apr 25 '24 08:04 tuukka