I feel like I'm missing something here. This just started happening after I changed the name of the function being decorated. I tried running this through pdb but I can't figure out where the ImportError is being thrown.
$ chalice --version
chalice 1.6.0, python 3.6.3, darwin 17.7.0
$ chalice deploy
Creating deployment package.
Traceback (most recent call last):
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/chalice/cli/__init__.py", line 447, in main
return cli(obj={})
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(args, *kwargs)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, *ctx.params)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(args, *kwargs)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, *kwargs)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/chalice/cli/__init__.py", line 183, in deploy
deployed_values = d.deploy(config, chalice_stage_name=stage)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/chalice/deploy/deployer.py", line 330, in deploy
return self._deploy(config, chalice_stage_name)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/chalice/deploy/deployer.py", line 340, in _deploy
self._build_stage.execute(config, resources)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/chalice/deploy/deployer.py", line 823, in execute
step.handle(config, resource)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/chalice/deploy/deployer.py", line 721, in handle
handler(config, resource)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/chalice/deploy/deployer.py", line 748, in handle_deploymentpackage
config.project_dir, config.lambda_python_version
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/chalice/deploy/packager.py", line 84, in create_deployment_package
requirements_filepath, site_packages_dir)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/chalice/deploy/packager.py", line 478, in build_site_packages
tempdir, requirements_filepath)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/chalice/deploy/packager.py", line 357, in _download_dependencies
requirements_filename, directory)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/chalice/deploy/packager.py", line 319, in _download_all_dependencies
self._pip.download_all_dependencies(requirements_filename, directory)
File "/Users/matt/.local/share/virtualenvs/lesscast-s3-WnEMZ3kV/lib/python3.6/site-packages/chalice/deploy/packager.py", line 716, in download_all_dependencies
raise PackageDownloadError(error)
chalice.deploy.packager.PackageDownloadError: Traceback (most recent call last):
File "
ImportError: cannot import name 'main'
You are probably running chalice==1.6.0 and a recent pip.
The current release of chalice requires 'pip>=9,<11'. Development version supports latest pip.
That would seem to be the problem. I'm running pip 18.0 in the venv.
I upgraded to the development version of chalice and it works now. Thanks for the help!
Having same issue. Can someone provide instructions on installing development version of Chalice?
So I did it using pipenv but the options are the same with pip. You do
pip install -e git+https://github.com/aws/chalice.git#egg=chalice
Most helpful comment
So I did it using pipenv but the options are the same with pip. You do
pip install -e git+https://github.com/aws/chalice.git#egg=chalice