cookiecutter数据科学模板

时间:2018-03-24 18:43:52

标签: python git cookiecutter

我使用

安装了cookiecutter
`conda install cookiecutter` 

但是当我尝试使用

从git hub导入repo时
`cookiecutter https://github.com/drivendata/cookiecutter-data-science`

我收到以下错误消息:

{

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. 

}

4 个答案:

答案 0 :(得分:1)

你需要git可以克隆的东西。使用https://github.com/drivendata/cookiecutter-data-science.git(这是您在Github中单击“克隆或下载”按钮时获得的链接)

答案 1 :(得分:0)

我像你上面那样安装了软件包:

conda install cookiecutter

等到安装发生后再使用:

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

我得到了以下输出

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

上面的人说这不是一个有效的git,但它对我有用。

答案 2 :(得分:0)

我只是想为来这里的人们提供一个澄清,因为他们有类似的问题。问题不在于该地址不是有效的git链接。您可以给cookiecutter一个指向github存储库的常规URL,只要您的环境路径中安装了cookiecooker的目录,它就可以工作。我不在Windows上,因此无法确认,但是check the documentation了解有关调整路径的更多详细信息。记住,如果要使用Anaconda而不是使用系统Python,则应考虑在内。

对我来说,这在Mac上是一个简单的过程,因为我在安装Anaconda时遵循了提示,但是我需要在Ubuntu计算机上手动添加路径

答案 3 :(得分:0)

我在公司防火墙后面,该防火墙阻止了我使用

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

这对落在这里的其他人来说可能是个问题。