microsoft / PTVS

Python Tools for Visual Studio
https://aka.ms/PTVS
Apache License 2.0
2.53k stars 675 forks source link

Failed to create "tiangolo/full-stack-fastapi-postgresql" template in Cookiecutter. #7760

Open ttSpace opened 11 months ago

ttSpace commented 11 months ago

Describe the bug

image

Steps to Reproduce

  1. Launch VS
  2. Click "View->Cookiecutter Explorer"
  3. Select "tiangolo/full-stack-fastapi-postgresql" to click "Next"
  4. Wait for load successfully and then click "Create and Open Folder"

Expected behavior

It should create successfully.

Additional context and screenshots

An error occurred while creating the template.

image

Logs

Output for General in the Output panel

``` ----- Cloning template 'tiangolo/full-stack-fastapi-postgresql' ----- Cloning into 'full-stack-fastapi-postgresql'... ----- Successfully cloned template 'tiangolo/full-stack-fastapi-postgresql' to 'C:\Users\vting\.cookiecutters\full-stack-fastapi-postgresql' ----- ----- Loading template 'tiangolo/full-stack-fastapi-postgresql' ----- {"cookiecutter": {"project_name": "Base Project", "project_slug": "{{ cookiecutter.project_name|lower|replace(' ', '-') }}", "domain_main": "{{cookiecutter.project_slug}}.com", "domain_staging": "stag.{{cookiecutter.domain_main}}", "docker_swarm_stack_name_main": "{{cookiecutter.domain_main|replace('.', '-')}}", "docker_swarm_stack_name_staging": "{{cookiecutter.domain_staging|replace('.', '-')}}", "secret_key": "changethis", "first_superuser": "admin@{{cookiecutter.domain_main}}", "first_superuser_password": "changethis", "backend_cors_origins": "[\"http://localhost\", \"http://localhost:4200\", \"http://localhost:3000\", \"http://localhost:8080\", \"https://localhost\", \"https://localhost:4200\", \"https://localhost:3000\", \"https://localhost:8080\", \"http://dev.{{cookiecutter.domain_main}}\", \"https://{{cookiecutter.domain_staging}}\", \"https://{{cookiecutter.domain_main}}\", \"http://local.dockertoolbox.tiangolo.com\", \"http://localhost.tiangolo.com\"]", "smtp_port": "587", "smtp_host": "", "smtp_user": "", "smtp_password": "", "smtp_emails_from_email": "info@{{cookiecutter.domain_main}}", "postgres_password": "changethis", "pgadmin_default_user": "{{cookiecutter.first_superuser}}", "pgadmin_default_user_password": "{{cookiecutter.first_superuser_password}}", "traefik_constraint_tag": "{{cookiecutter.domain_main}}", "traefik_constraint_tag_staging": "{{cookiecutter.domain_staging}}", "traefik_public_constraint_tag": "traefik-public", "flower_auth": "admin:{{cookiecutter.first_superuser_password}}", "sentry_dsn": "", "docker_image_prefix": "", "docker_image_backend": "{{cookiecutter.docker_image_prefix}}backend", "docker_image_celeryworker": "{{cookiecutter.docker_image_prefix}}celeryworker", "docker_image_frontend": "{{cookiecutter.docker_image_prefix}}frontend", "_copy_without_render": ["frontend/src/**/*.html", "frontend/src/**/*.vue", "frontend/node_modules/*", "backend/app/app/email-templates/**"]}} ----- Successfully loaded template 'tiangolo/full-stack-fastapi-postgresql' ----- ----- Creating files using template 'tiangolo/full-stack-fastapi-postgresql' ----- DEBUG main.py: context_file is C:\Users\vting\.cookiecutters\full-stack-fastapi-postgresql\cookiecutter.json DEBUG generate.py: Context generated is {'cookiecutter': OrderedDict([('project_name', 'Base Project'), ('project_slug', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('domain_main', '{{cookiecutter.project_slug}}.com'), ('domain_staging', 'stag.{{cookiecutter.domain_main}}'), ('docker_swarm_stack_name_main', "{{cookiecutter.domain_main|replace('.', '-')}}"), ('docker_swarm_stack_name_staging', "{{cookiecutter.domain_staging|replace('.', '-')}}"), ('secret_key', 'changethis'), ('first_superuser', 'admin@{{cookiecutter.domain_main}}'), ('first_superuser_password', 'changethis'), ('backend_cors_origins', '["http://localhost", "http://localhost:4200", "http://localhost:3000", "http://localhost:8080", "https://localhost", "https://localhost:4200", "https://localhost:3000", "https://localhost:8080", "http://dev.{{cookiecutter.domain_main}}", "https://{{cookiecutter.domain_staging}}", "https://{{cookiecutter.domain_main}}", "http://local.dockertoolbox.tiangolo.com", "http://localhost.tiangolo.com"]'), ('smtp_port', '587'), ('smtp_host', ''), ('smtp_user', ''), ('smtp_password', ''), ('smtp_emails_from_email', 'info@{{cookiecutter.domain_main}}'), ('postgres_password', 'changethis'), ('pgadmin_default_user', '{{cookiecutter.first_superuser}}'), ('pgadmin_default_user_password', '{{cookiecutter.first_superuser_password}}'), ('traefik_constraint_tag', '{{cookiecutter.domain_main}}'), ('traefik_constraint_tag_staging', '{{cookiecutter.domain_staging}}'), ('traefik_public_constraint_tag', 'traefik-public'), ('flower_auth', 'admin:{{cookiecutter.first_superuser_password}}'), ('sentry_dsn', ''), ('docker_image_prefix', ''), ('docker_image_backend', '{{cookiecutter.docker_image_prefix}}backend'), ('docker_image_celeryworker', '{{cookiecutter.docker_image_prefix}}celeryworker'), ('docker_image_frontend', '{{cookiecutter.docker_image_prefix}}frontend'), ('_copy_without_render', ['frontend/src/**/*.html', 'frontend/src/**/*.vue', 'frontend/node_modules/*', 'backend/app/app/email-templates/**'])])} DEBUG utils.py: Making sure path exists: C:\Users\vting/.cookiecutter_replay/ DEBUG find.py: Searching C:\Users\vting\.cookiecutters\full-stack-fastapi-postgresql for the project template. Traceback (most recent call last): File "c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\cookiecutter\cookiecutter_run.py", line 46, in sys.exit(int(main() or 0)) File "c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\cookiecutter\cookiecutter_run.py", line 37, in main cookiecutter( File "C:\Users\vting\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\Local\Microsoft\CookiecutterTools\env\lib\site-packages\cookiecutter\main.py", line 140, in cookiecutter return generate_files( File "C:\Users\vting\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\Local\Microsoft\CookiecutterTools\env\lib\site-packages\cookiecutter\generate.py", line 253, in generate_files template_dir = find_template(repo_dir) File "C:\Users\vting\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\Local\Microsoft\CookiecutterTools\env\lib\site-packages\cookiecutter\find.py", line 42, in find_template raise NonTemplatedInputDirException cookiecutter.exceptions.NonTemplatedInputDirException C:\Users\vting\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\Local\Microsoft\CookiecutterTools\env\scripts\python.exe returned an exit code of 1. ----- Failed to create files using template 'tiangolo/full-stack-fastapi-postgresql' ----- ```

StellaHuang95 commented 11 months ago

From reading the logs DEBUG utils.py: Making sure path exists: C:\Users\vting/.cookiecutter_replay/, looks like it's for a directory that doesn't exist?

ttSpace commented 11 months ago

The directory exists.

image

weidlu commented 11 months ago

I'm experiencing the same issue. Has a solution been identified?