question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cookiecutter fails to install the project after a cookiecutter template was cloned

See original GitHub issue

In latest Visual studio 2017I go to File --> New -->–> From Cookiecutter. Then I select an arbitrary template and click Run or Next. I see in the output window that the repository is cloned, but then I get an error, e.g.

----- Cloning template 'audreyr/cookiecutter-pypackage' -----
Cloning into 'cookiecutter-pypackage'...
----- Successfully cloned template 'audreyr/cookiecutter-pypackage' to 'C:\Users\pavol\.cookiecutters\cookiecutter-pypackage' -----
----- Installing cookiecutter -----
C:\tools\Anaconda3\python.exe returned an exit code of 1.
----- Failed to install cookiecutter -----

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jancuracommented, Dec 14, 2017

Indeed, my Anaconda installation made its Python the default (I used Chocolatey, which by default registers anaconda python as default python3). When I uninstalled Anaconda and installed with Chocolatey again but specifying not to register the default python, the cookiecutter was successfully installed and everything seems to work now.

Thanks for your help.

1reaction
zoobacommented, Dec 14, 2017

That should be easy to check - if you go to the folder @huguesv mentioned above and find bin\python.exe then it’s been created from Anaconda. We shouldn’t do this, since they do some things “differently” that may be problematic.

I believe we actually look for the latest version of Python available, so if you selected the option in the Anaconda installer to make it the default it’s now claiming to be a regular Python install and there’s nothing we can do about it. As a workaround, you should be able to run these commands from a command prompt:

<path to Python 3.6> -m venv "%localappdata%\Microsoft\CookiecutterTools\env"
"%localappdata%\Microsoft\CookiecutterTools\env\Scripts\pip" install cookiecutter<1.5

This is essentially what our tool should be doing. Unfortunately, if Anaconda has overwritten the CPython registry keys, we don’t have any way to do it automatically.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't install Cookiecutter please?
This is caused by failure of command git clone . A workaround: You can go to ithub.com:Dekalabs/cookiecutter-backend.git , download the ...
Read more >
Use CookieCutter templates with Python - Visual Studio ...
Cookiecutter templates are cloned under a single folder ... After the template is installed locally, Cookiecutter displays an options page ...
Read more >
Installation — cookiecutter 2.3.0 documentation - Read the Docs
First, read History in detail. There are a lot of major changes. The big ones are: Cookiecutter no longer deletes the cloned repo...
Read more >
cookiecutter 1.1.0
A command-line utility that creates projects from project templates, e.g. creating a Python package project from a Python package project template.
Read more >
How to write a Cookiecutter template - Cortex
In this how-to, we'll go through building your own simple Cookiecutter project template to get comfortable with the syntax. From this, you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found