sam init errors with "No module named functools_lru_cache"
See original GitHub issueDescription:
Steps to reproduce the issue:
$ sam init
Observed result:
[+] Initializing project structure...
Error: An error ocurred while generating this sam-app: Unable to load extension: No module named functools_lru_cache
Expected result:
It just works!™
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
macOS 10.13.5
Output of sam --version
:
SAM CLI, version 0.3.0
Optional Debug logs:
$ sam init --debug
2018-06-11 19:49:22 Init command
[+] Initializing project structure...
2018-06-11 19:49:22 Parameters dict created with input given
2018-06-11 19:49:22 {'no_input': False, 'output_dir': '.', 'template': '/Users/anon/Library/Python/2.7/lib/python/site-packages/samcli/local/init/templates/cookiecutter-aws-sam-hello-nodejs'}
2018-06-11 19:49:22 Parameters dict updated with project name as extra_context
2018-06-11 19:49:22 {'extra_context': {'project_name': u'sam-app', 'runtime': 'nodejs8.10'}, 'no_input': True, 'output_dir': '.', 'template': '/Users/anon/Library/Python/2.7/lib/python/site-packages/samcli/local/init/templates/cookiecutter-aws-sam-hello-nodejs'}
2018-06-11 19:49:22 Baking a new template with cookiecutter with all parameters
2018-06-11 19:49:22 context_file is /Users/anon/Library/Python/2.7/lib/python/site-packages/samcli/local/init/templates/cookiecutter-aws-sam-hello-nodejs/cookiecutter.json
2018-06-11 19:49:22 Context generated is {u'cookiecutter': OrderedDict([(u'project_name', u'sam-app'), (u'runtime', 'nodejs8.10')])}
Error: An error ocurred while generating this sam-app: Unable to load extension: No module named functools_lru_cache
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (9 by maintainers)
Top Results From Across the Web
sam init errors with "No module named functools_lru_cache"
Description: Steps to reproduce the issue: $ sam init Observed result: [+] Initializing project structure... Error: An error ocurred while ...
Read more >sam init - AWS Serverless Application Model
Initializes a serverless application with an AWS SAM template. ... If you're not sure, call sam init without options for an interactive workflow....
Read more >Python not finding module when running AWS sam local invoke
SAM invoke can't seem to find a python module that my lambda handler is importing but I can otherwise import that module. The...
Read more >Tutorial - AWS Lambda Powertools for Python
Tutorial. This tutorial progressively introduces Lambda Powertools core utilities by using one feature at a time.
Read more >aws-sam-cli - AUR (en) - Arch Linux
Out of Date ... Git Clone URL: https://aur.archlinux.org/aws-sam-cli.git (read-only, ... Hitting a ModuleNotFoundError: No module named ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the same problem today. Resolved be uninstalling and installing backports.functools_lru_cache.
pip uninstall backports.functools_lru_cache
pip install backports.functools_lru_cache
After this everything is working again.
The root cause seems that the functools_lru_cache related files were missing -
The above solution of uninstall/install didn’t work for me. matplotlib devs on Ubuntu were having same issue. Following their discussion, fixed the missing module issue with following command -
sudo apt-get install python-matplotlib