__I'm submitting a ...__
Do you want to request a feature or report a bug?
Report a bug.
When following the steps described here, I receive the following error (using both Python3.5 and Python3.6),
$ cookiecutter https://github.com/pydanny/cookiecutter-django
You've downloaded /Users/statwonk/.cookiecutters/cookiecutter-django before. Is it okay to delete and re-download it? [yes]: yes
Unable to load extension: No module named functools_lru_cache
$ virtualenv --python=python3.6 venv
$ source venv/bin/activate
$ pip install "cookiecutter>=1.4.0"
$ cookiecutter https://github.com/pydanny/cookiecutter-django
A sequence that asks for the set of Cookiecutter options I'd like to select. Instead I see,
$ cookiecutter https://github.com/pydanny/cookiecutter-django
You've downloaded /Users/statwonk/.cookiecutters/cookiecutter-django before. Is it okay to delete and re-download it? [yes]: yes
Unable to load extension: No module named functools_lru_cache
and the process ends.
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Mac OS X, brew installed.
I suspect this is a Cookiecutter issue, not related to Cookiecutter Django. Some questions:
Ah! I installed Cookiecutter with pip install "cookiecutter>=1.4.0" _after_ activating the python3.5 and/or python3.6 virtualenv.
It looks like your theory is right as I see the same issue with cookiecutter-flask,
$ cookiecutter https://github.com/pydanny/cookiecutter-flask
Unable to load extension: No module named functools_lru_cache
In your virtualenv, try: pip install -U cookiecutter
Cookiecutter comes with a --version flag which also tells you where it is installed.
cookiecutter --version
Ah, I might have found the culprit! Event after using pip install -U cookiecutter with the virtualenv activated (python3.6), I saw the same error. However when I run, cookiecutter --version I see,
$ cookiecutter --version
Cookiecutter 1.6.0 from /usr/local/lib/python2.7/site-packages (Python 2.7)
Appears the global 2.7 version is being used? I'm surprised the virtualenv didn't protect me from this.
I found out this the hard way as well. I use "pyenv" now.
The pip command is probably linked to Python 2.7. Try pip3 instead.
Thank you all!
For others that may find this. I hit this again and outside of the virutualenv (deactivated), I had to, pip uninstall cookiecutter to remote the 2.7 version. That is activating a new virtualenv, pip3 install cookiecutter won't necessarily prevent the global library from being used.
Most helpful comment
The
pipcommand is probably linked to Python 2.7. Trypip3instead.