Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook script failed: pre_gen_project hook script didn't exit successfully #399

Open
phoeniXharsh opened this issue Sep 29, 2024 · 3 comments

Comments

@phoeniXharsh
Copy link

I've installed cookiecutter-data-science in my global environment and tried running ccds command but it failed abruptly. Can't able to debug it. The error which I'm getting is below:

ERROR: Stopping generation because pre_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

The python version which I'm using is 3.9.0 and cookiecutter version is 2.6.0

I'm attaching the full set of commands below

PS C:\Users\HarshVardhan> cookiecutter --version
Cookiecutter 2.6.0 from c:\users\harshvardhan\appdata\local\programs\python\python39\lib\site-packages (Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)])
PS C:\Users\HarshVardhan> python --version
Python 3.9.0
PS C:\Users\HarshVardhan> ccds
You've downloaded C:\Users\HarshVardhan\.cookiecutters\cookiecutter-data-science before. Is it okay to delete and re-download it? [y/n] (y): y
project_name (project_name): demo
repo_name (demo): demo
module_name (demo): demo
author_name (Your name (or your organization/company/team)): demo
description (A short description of the project.): demo
python_version_number (3.10): 3.9.0
Select dataset_storage
    1 - none
    2 - azure
    3 - s3
    4 - gcs
    Choose from [1/2/3/4] (1):
Select environment_manager
    1 - virtualenv
    2 - conda
    3 - pipenv
    4 - none
    Choose from [1/2/3/4] (1):
Select dependency_file
    1 - requirements.txt
    2 - environment.yml
    3 - Pipfile
    Choose from [1/2/3] (1):
Select pydata_packages
    1 - none
    2 - basic
    Choose from [1/2] (1):
Select open_source_license
    1 - No license file
    2 - MIT
    3 - BSD-3-Clause
    Choose from [1/2/3] (1):
Select docs
    1 - mkdocs
    2 - none
    Choose from [1/2] (1):
Select include_code_scaffold
    1 - Yes
    2 - No
    Choose from [1/2] (1):
ERROR: Stopping generation because pre_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

Note: I've checked the environment variables for python and it's perfectly fine there.

@chrisjkuch
Copy link
Contributor

Hey @phoeniXharsh, can you try with a more recently released version of Python 3.9? We test on Windows back to Python 3.9 but only against the most recent versions, and 3.9.0 is nearly 4 years old.

@phoeniXharsh
Copy link
Author

phoeniXharsh commented Sep 29, 2024

@chrisjkuch I tried it will another Python version I had in my system i.e Python 3.11.4 which was released last year. Got the same error

(myenv) PS D:\Python_ML\MLOps\nyc-taxi-trip-analysis\test> cookiecutter --version
Cookiecutter 2.6.0 from D:\Python_ML\MLOps\nyc-taxi-trip-analysis\test\myenv\Lib\site-packages (Python 3.11.4 (tags/v3.11.4:d2340ef, Jun  7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)])
(myenv) PS D:\Python_ML\MLOps\nyc-taxi-trip-analysis\test> python --version
Python 3.11.4
(myenv) PS D:\Python_ML\MLOps\nyc-taxi-trip-analysis\test> ccds
You've downloaded C:\Users\HarshVardhan\.cookiecutters\cookiecutter-data-science before. Is it okay to delete 
and re-download it? [y/n] (y): y
project_name (project_name): demo
repo_name (demo): demo
module_name (demo): demo
author_name (Your name (or your organization/company/team)): demo
description (A short description of the project.): demo
python_version_number (3.10): 3.11.4
Select dataset_storage
    1 - none
    2 - azure
    3 - s3
    4 - gcs
    Choose from [1/2/3/4] (1):
Select environment_manager
    1 - virtualenv
    2 - conda
    3 - pipenv
    4 - none
    Choose from [1/2/3/4] (1):
Select dependency_file
    1 - requirements.txt
    2 - environment.yml
    3 - Pipfile
    Choose from [1/2/3] (1):
Select pydata_packages
    1 - none
    2 - basic
    Choose from [1/2] (1):
Select open_source_license
    1 - No license file
    2 - MIT
    3 - BSD-3-Clause
    Choose from [1/2/3] (1):
Select docs
    1 - mkdocs
    2 - none
    Choose from [1/2] (1):
Select include_code_scaffold
    1 - Yes
    2 - No
    Choose from [1/2] (1):
ERROR: Stopping generation because pre_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

@chrisjkuch
Copy link
Contributor

Can you make sure the ccds you're using comes from that environment? Something like which ccds? Can you also try running verbosely (ccds -v) our outputting to a debug file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants