我正在尝试使用python从cookiecutter创建一个项目。我已经通过pip在Windows上全局安装了cookiecutter (我没有使用虚拟环境
pip3 install cookiecutter我可以在GitBash中使用cookiecutter作为命令。但是,当我尝试在python脚本中使用它时(基于these指令),我得到:
ModuleNotFoundError: No module named 'cookiecutter.main'; 'cookiecutter' is not a package下面是脚本文件:
from cookiecutter.main import cookiecutter
cookiecutter(
'<redacted>',
no_input=True,
extra_context={
'directory_name': 'bar',
'file_name': 'baz',
'greeting_recipient': 'inga'
}
)这里我漏掉了什么?
编辑我也尝试过使用Windows标准命令提示符,以及Linux中的virtualenv。结果总是一样的。/edit
发布于 2018-12-28 14:12:20
尝尝这个。
import cookiecutter
import cookiecutter.main像这样调用:
cookiecutter.main.cookiecutterhttps://stackoverflow.com/questions/53953900
复制相似问题