简体   繁体   中英

cookiecutter data science templet

I installed cookiecutter using

`conda install cookiecutter` 

but when I try to import the repo from git hub using

`cookiecutter https://github.com/drivendata/cookiecutter-data-science`

I got the following error message:

{

Traceback (most recent call last):
File "C:\Users\iamuraptha\Anaconda3\Scripts\cookiecutter-script.py", line 5, in <module>
    sys.exit(cookiecutter.cli.main())
  File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\cookiecutter\cli.py", line 120, in main
    password=os.environ.get('COOKIECUTTER_REPO_PASSWORD')
  File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\cookiecutter\main.py", line 63, in cookiecutter
    password=password
  File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\cookiecutter\repository.py", line 103, in determine_repo_dir
    no_input=no_input,
  File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\cookiecutter\vcs.py", line 99, in clone
    stderr=subprocess.STDOUT,
  File "C:\Users\iamuraptha\Anaconda3\lib\subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "C:\Users\iamuraptha\Anaconda3\lib\subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/drivendata/cookiecutter-data-science']' returned non-zero exit status 128. 

}

You need something git can clone. Use https://github.com/drivendata/cookiecutter-data-science.git (this is the link you get when you click the 'clone or download' button in Github)

I just wanted to add a clarification for people coming here because they have a somewhat similar problem. The problem is not that the address isn't a valid git link. You can give cookiecutter a regular URL to a github repo and it will work, provided the directory in which cookiecooker is installed is in your environment's path. I'm not on Windows so I can't confirm, butcheck the documentation for more details about adjusting the path. And remember to factor Anaconda in if you are using it instead of the system Python.

For me this was a straightforward process on a Mac because I followed the prompt when I installed Anaconda, but I needed to add the path manually on Ubuntu machine

I installed the package like you did above:

conda install cookiecutter

Waited until the installation happened and then used:

cookiecutter https://github.com/drivendata/cookiecutter-data-science

I got the following output

project_name [project_name]: Fred
repo_name [Fred]: Fred
author_name [Your name (or your organization/company/team)]: Joseph 
Cunningham
description [A short description of the project.]: test
Select open_source_license:
1 - MIT
2 - BSD-3-Clause
3 - No license file
Choose from 1, 2, 3 [1]: 3
s3_bucket [[OPTIONAL] your-bucket-for-syncing-data (do not include 
's3://')]: 
aws_profile [default]: 
Select python_interpreter:
1 - python
2 - python3
Choose from 1, 2 [1]: 2

The people above are saying it is not a valid git but it worked for me.

I was behind a corporate firewall which prevented me from using

'cookiecutter https://github.com/drivendata/cookiecutter-data-science' 

This may be an issue for someone else who lands up here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM