-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: cannot import name shlex_quote #1051
Comments
Looks like we need six > 1.8.0. (https://mail.python.org/pipermail/python-porting/2014-September/000449.html)
|
This is still happening on OS X 10.10.1 with six 1.8.0:
Downgrading to aswcli 1.6.6 works for now. |
Seeing this on AWS CentOS7 as well (awscli v1.6.7). Also confirmed that downgrading to v1.6.6 solves the problem. |
Also seeing this on Ubuntu 14.04, downgrade to v1.6.6 fixes on it as well. |
I'm trying to repro this. Can you share how you're installing the AWS CLI? I think we can bump the min version of six in the AWS CLI to 1.8.0, but the fact that botocore (a dependency) requires six >=1.8.0 means that pip should pull in this newer version of six automatically.
|
@jamesls does this help?
|
Here is the repo steps:
Any other ways to repo this would be great so we can check all of these when we make the fix. |
Thanks for all of the help here! We have a pull request merged that should fix it: We are going to try to get a release out soon to patch this issue. Closing for now. |
Version 1.6.8 is now available and should fix this issue. |
I had to uninstall six and manually "pip install six==1.8.0" to stop the shlex_quote error |
Version 1.6.8 still gives the shlex_quote error for me on OS X 10.10.1, even with six 1.8.0 installed. Reverting to 1.6.6 solves it for me. |
Yep, 1.6.8 has not solved the issue on OS X 10.10.1 for me either. Back to 1.6.6 is fine. |
Same here, Ubuntu 14.04.1, problem is not solved with six 1.8.0, Reverting to 1.6.6 helped. |
Taking a look. I don't have access to a 10.10.1 machine, but I'll try this on an ubuntu 14.04.1 instance and see what I can find. From what I can tell I'm guessing that six is not being upgraded to 1.8.0 despite the fact we call out this requirements in our setup.py. How are you upgrading? Are you running I'll see what I can find on an ubuntu machine. |
I'm still not able to repro this issue, at least on Ubuntu 14.04. On OS X 10.10.1 and Ubuntu, it looks like there are reports of six==1.8.0 being installed, but not being able to shlex_quote. For users seeing that problem, could you try the following to help debug:
Ideally if you have six==1.8.0 installed, you should see similar output, with the exception of the last line which prints the file path to where the six module is installed which may vary. |
I think you're on to something. Here's what I'm getting on OS X 10.10.1:
However:
|
Also, to help with additional debugging, here's what I tried on a fresh EC2 instance running ubuntu 14.04:
|
Here's what I get on 10.10.1: $ /usr/bin/python
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import six
>>> six.__version__
'1.4.1'
>>> print(six.__file__)
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six.pyc
>>> From a virtualenv with it installed: Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import six
>>> six.__version__
'1.8.0'
>>> print six.moves.shlex_quote
<function quote at 0x10dc9c230>
>>> print(six.__file__)
/....../venv/lib/python2.7/site-packages/six.pyc |
@danielgtaylor what if you try to install the AWS CLI system wide instead of in a virtualenv (upgrading from 1.6.6)? i.e
|
This seems to be the default sys.path on OS X, which seems to what is causing the problems. pip installs into /Library/Python/2.7/site-packages, which is last in the path.
|
@ajkerr Ahh that explains it! In that case, I'm not really sure there's much we can do with our current approach as the CLI shouldn't really be messing with So here's what we'll do. Given six is just a single file, we'll go ahead and vendor six into our codebase instead of installing it via pip. Given six is used by a ton of python modules, this gives us the flexibility to upgrade the version of six as needed. This also should make it easier for distro package maintainers as they don't need to pull in the latest version of six either to update their version of the AWS CLI. And given there's a couple of mac users on this thread, what does everything think about a pkg installer? Would any mac users find this useful? I think we'd probably use the bundled installer to power it, but I think this would likely prevent any possible issues like this we'd see in the future. We'd still support pip, but just wanted to gauge interest for a mac pkg installer. cc @ajkerr @bok- |
@jamesls A pkg installer would be fine with me, as long as we can still use pip (which you're saying we can, which is good!) |
A package installer is fine as long as there is a simple path for regular upgrades (via pip or otherwise). |
Alright, we believe this should be working now via this PR: We vendored six into botocore and the cli now uses botocore's vendored six. That way we won't run into anymore OS related issues related to the installation of six. This will be out in the next release. Closing for now. Let me know if any of you run into any similar issues when it does come out or if you pull down the head of the develop branch and still does not work. |
Confirmed fixed with v1.6.9 on OS X 10.10.1. Thanks! |
Looks like this (6a352c0) commit breaks aws cli on RHEL6 at least:
The text was updated successfully, but these errors were encountered: