Hide Forgot
Description of problem: After install awscli, usage fails as botocore is not installed. Version-Release number of selected component (if applicable): awscli-1.14.28-5.el7_5.1.noarch How reproducible: 100% Steps to Reproduce: # yum install awscli ... =================================================================================================================================================================================================================== Package Arch Version Repository Size =================================================================================================================================================================================================================== Installing: awscli noarch 1.14.28-5.el7_5.1 base 1.0 M Installing for dependencies: PyYAML x86_64 3.10-11.el7 base 153 k jbigkit-libs x86_64 2.0-11.el7 base 46 k libjpeg-turbo x86_64 1.2.90-6.el7 base 134 k libtiff x86_64 4.0.3-27.el7_3 base 170 k libwebp x86_64 0.3.0-7.el7 base 170 k libyaml x86_64 0.1.4-11.el7_0 base 55 k python-backports x86_64 1.0-8.el7 base 5.8 k python-backports-ssl_match_hostname noarch 3.5.0.1-1.el7 base 13 k python-cffi x86_64 1.6.0-5.el7 base 218 k python-dateutil noarch 1.5-7.el7 base 85 k python-docutils noarch 0.11-0.3.20130715svn7687.el7 base 1.5 M python-enum34 noarch 1.0.4-1.el7 base 52 k python-idna noarch 2.4-1.el7 base 94 k python-ipaddress noarch 1.0.16-2.el7 base 34 k python-pillow x86_64 2.0.0-19.gitd1c6db8.el7 base 438 k python-ply noarch 3.4-11.el7 base 123 k python-pycparser noarch 2.14-1.el7 base 104 k python-s3transfer noarch 0.1.13-1.el7 base 2.9 M python-setuptools noarch 0.9.8-7.el7 base 397 k python-six noarch 1.9.0-2.el7 base 29 k python2-cryptography x86_64 1.7.2-2.el7 base 502 k python2-pyasn1 noarch 0.1.9-7.el7 base 100 k ... # aws Traceback (most recent call last): File "/usr/bin/aws", line 19, in <module> import awscli.clidriver File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 18, in <module> import botocore.session ImportError: No module named botocore.session Actual results: ImportError: No module named botocore.session Expected results: aws command works
Jon, Our development team hasn't been able to easily replicate the issue you've been experiencing wherein awscli is missing botocore on install. To further troubleshoot the circumstances of this failure, it would be helpful if you could open a support ticket directly with Red Hat via the customer portal at access.redhat.com so that our support team can work with you to define the parameters of the issue, nail down the replication, and bring it back to the development team for further analysis. The development team doesn't always have the time or resources to do deep dive troubleshooting for these sorts of issues, so we depend on our support team to handle this in advance. If you have any questions about opening a support ticket or need assistance doign so, please contact Red Hat Support: https://access.redhat.com/support/contact/technicalSupport When you open the ticket, feel free to reference this bugzilla in the ticket as well! Thank you! Regards, Cole Towsley, RHCE Software Maintenance Engineer Red Hat Inc.
Yeah, it appears that the dependency list for the awscli rpm is missing a few things: [root@ip-10-0-4-107 log]# yum deplist awscli ... package: awscli.noarch 1.14.28-5.el7_5.1 dependency: /usr/bin/python2 provider: python.x86_64 2.7.5-76.el7 dependency: PyYAML >= 3.10 provider: PyYAML.x86_64 3.10-11.el7 dependency: python(abi) = 2.7 provider: python.x86_64 2.7.5-76.el7 dependency: python-cryptography >= 1.7.2 provider: python2-cryptography.x86_64 1.7.2-2.el7 dependency: python-docutils >= 0.10 provider: python-docutils.noarch 0.11-0.3.20130715svn7687.el7 dependency: python-s3transfer >= 0.1.9 provider: python2-s3transfer.noarch 0.1.10-1.el7 provider: python-s3transfer.noarch 0.1.13-1.el7 even after installing the python2-botocore package, it appears to be out of sync with the available botocore package according to https://github.com/aws/aws-cli/issues/2999 # aws --version Traceback (most recent call last): File "/bin/aws", line 19, in <module> import awscli.clidriver File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 25, in <module> from botocore.history import get_global_history_recorder ImportError: No module named history python2-botocore-1.6.0-1.el7.noarch
I can reproduce the issue with Vagrant and the following Vagrantfile: Vagrant.configure("2") do |config| config.vm.box = "bento/centos-7.5" config.vm.provision "shell", inline: <<-SHELL yum upgrade yum install -y awscli aws SHELL end It seems that no package provides the required file: $ yum whatprovides /usr/lib/python2.7/site-packages/boto/session.py default: No matches found The package python-boto3 provides the file boto3/session.py, but this is inconsistent with the source code shipped with awscli. The package mentioned in the previous comment is from the EPEL repository (while awscli is from base), which would explain why installing python2-botocore introduces further issues.
I think there is a typo the 'whatprovides' command. Given the error 'ImportError: No module named botocore.session', I think the 'boto' should be 'botocore'. The point remains the same though, that file doesn't exist. $ yum whatprovides /usr/lib/python2.7/site-packages/botocore/session.py ... No matches found
I'm investigating this as we're hitting the issue as well. In order to get a working awscli package, one either need to downgrade to the version EPEL once shipped : """ yum remove awscli python-s3transfer yum install awscli-1.11.133-1.el7 python2-s3transfer-0.1.10-1.el7 --exclude=python-s3transfer """ I'm not sure the packages are still available in EPEL, I'm taking them from a local mirror, but they are likely still available somewhere, at least in Koji. Alternatively, and this is probably a better fix, one can use an updated python2-botocore package from EPEL on a fully updated RHEL/CentOS 7.6, that is with awscli-1.14.28-5.el7_5.1.noarch and python-s3transfer-0.1.13-1.el7.noarch Here's how I proceeded. I took current epel7 git branch as the starting point: commit 0088212 (Update to 1.6.0) Then, rebased it to commit 9cf8648 (Bumping version to 1.10.43 Updates bz#1531330) Then, updated the EL7 patch to apply against 1.10.43. The resulting package, python2-botocore-1.10.43-1.el7.1.noarch, when added on top of awscli and python-s3transfer from RHEL/CentOS 7.6, fixes awscli for me. Here's the PR against python-botocore epel7 branch: https://src.fedoraproject.org/rpms/python-botocore/pull-request/2 If this is accepted, this would somewhat fix RHEL's awscli package. This is still not a proper solution to the issue at hand, as RHEL's awscli package should have the python2-botocore dependency added and then python-botocore should also be "adopted" in RHEL.
Per https://bugs.centos.org/view.php?id=15518, there appears to be a path inconsistency. We're using the hack detailed in that report, namely: sed -i -e 's/\/lib\//\/lib64\//' /usr/lib/python2.7/site-packages/awscli/clidriver.py Updating (using pip) also resolves this issue, but it bumps the version on a lot of dependencies.
I think this issue may have been fixed. After upgrading all system packages, I can no longer reproduce. The change may have come from package python-s3transfer-0.1.13-1.el7.0.1.noarch.
(In reply to Jon Dufresne from comment #9) > I think this issue may have been fixed. After upgrading all system packages, > I can no longer reproduce. The change may have come from package > python-s3transfer-0.1.13-1.el7.0.1.noarch. Same here. With the Vagrantfile proposed in a previous message, there is no longer dependency issue. I agree that the ticket can be closed now.
Thank you for the feedback.