Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

KeyError: 'pip._vendor.urllib3.contrib' #1447

Closed
oxbits opened this issue Mar 18, 2018 · 7 comments
Closed

KeyError: 'pip._vendor.urllib3.contrib' #1447

oxbits opened this issue Mar 18, 2018 · 7 comments

Comments

@oxbits
Copy link

oxbits commented Mar 18, 2018

$ zappa deploy
Calling deploy for stage dev..
Oh no! An error occurred! :(

==============

Traceback (most recent call last):
File "/Users/ox/.local/share/virtualenvs/ox-zje1HLlw/lib/python3.6/site-packages/zappa/cli.py", line 2610, in handle
sys.exit(cli.handle())
File "/Users/ox/.local/share/virtualenvs/ox-zje1HLlw/lib/python3.6/site-packages/zappa/cli.py", line 505, in handle
self.dispatch_command(self.command, stage)
File "/Users/ox/.local/share/virtualenvs/ox-zje1HLlw/lib/python3.6/site-packages/zappa/cli.py", line 539, in dispatch_command
self.deploy(self.vargs['zip'])
File "/Users/ox/.local/share/virtualenvs/ox-zje1HLlw/lib/python3.6/site-packages/zappa/cli.py", line 709, in deploy
self.create_package()
File "/Users/ox/.local/share/virtualenvs/ox-zje1HLlw/lib/python3.6/site-packages/zappa/cli.py", line 2171, in create_package
disable_progress=self.disable_progress
File "/Users/ox/.local/share/virtualenvs/ox-zje1HLlw/lib/python3.6/site-packages/zappa/core.py", line 447, in create_lambda_zip
import pip
File "/Users/ox/.local/share/virtualenvs/ox-zje1HLlw/lib/python3.6/site-packages/pip/init.py", line 45, in
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/Users/ox/.local/share/virtualenvs/ox-zje1HLlw/lib/python3.6/site-packages/pip/vcs/mercurial.py", line 9, in
from pip.download import path_to_url
File "/Users/ox/.local/share/virtualenvs/ox-zje1HLlw/lib/python3.6/site-packages/pip/download.py", line 40, in
from pip._vendor import requests, six
File "/Users/ox/.local/share/virtualenvs/ox-zje1HLlw/lib/python3.6/site-packages/pip/_vendor/requests/init.py", line 98, in
from . import packages
File "/Users/ox/.local/share/virtualenvs/ox-zje1HLlw/lib/python3.6/site-packages/pip/_vendor/requests/packages.py", line 12, in
sys.modules['pip._vendor.requests.packages.' + mod] = sys.modules["pip._vendor." + mod]
KeyError: 'pip._vendor.urllib3.contrib'

settings:

{
"dev": {
"app_function": "hello.app",
"aws_region": null,
"profile_name": null,
"project_name": "zappa-hey-yo",
"runtime": "python3.6",
"s3_bucket": "zappa-hwydhsa7d"
}

@suriya
Copy link
Contributor

suriya commented Mar 18, 2018

I was about to post this same issue in order to help others. After debugging for a while, I found that this is happening because of pip version 9.0.2, released 3 days ago (March 16, 2018).

If any one else is facing the same issue, downgrade to pip version 9.0.1 pip install pip==9.0.1 and Zappa will work as usual.

@suriya
Copy link
Contributor

suriya commented Mar 18, 2018

Duplicate of #1446

@oxbits
Copy link
Author

oxbits commented Mar 18, 2018

Nice work @suriya, thank you!

@rhyspowell
Copy link

thank you, was just about to start debugging!

@Miserlou
Copy link
Owner

Closing duplicate. Track upstream here: pypa/pip#5081

@LaundroMat
Copy link

For people on Windows in a virtualenv, downgrading won't work (you'll uninstall pip and then won't be able to reinstall the older version).

The solution is to uninstall pip (pip uninstall pip), then get the get-pip.py installation script from the pip docs and then do python get-pip.py pip==9.0.1

@missmint27
Copy link

Thank you sooo much, but why?

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

6 participants