We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae415e3 commit 0dbde29Copy full SHA for 0dbde29
src/tailwind/management/commands/tailwind.py
@@ -77,8 +77,15 @@ def handle_init_command(self, **options):
77
from cookiecutter.main import cookiecutter
78
except ImportError:
79
self.stdout.write("Cookiecutter is not found, installing...")
80
- install_pip_package("cookiecutter")
81
- from cookiecutter.main import cookiecutter
+ try:
+ raise ModuleNotFoundError
82
+ install_pip_package("cookiecutter")
83
+ from cookiecutter.main import cookiecutter
84
+ except ModuleNotFoundError:
85
+ raise CommandError(
86
+ "Failed to install 'cookiecutter' via pip. Please install it manually "
87
+ "(https://pypi.org/project/cookiecutter/) and run 'python manage.py tailwind init' again."
88
+ )
89
90
try:
91
app_path = cookiecutter(
0 commit comments