S3cmd ImportError: No module named S3.Exceptions

Got an error after installing and trying to start s3cmd 1.0.0

s3cmd -h Problem: ImportError: No module named S3.Exceptions S3cmd: unknown version. Module import problem? Traceback (most recent call last): File "/usr/bin/s3cmd", line 1995, in <module> from S3.Exceptions import * ImportError: No module named S3.Exceptions Your sys.path contains these entries: 

This error occurred after updating to the latest Amazon Linux 2015.03.0 distribution

+5
source share
4 answers

It seems like an error occurred because python2.7 is now the default default python version on Amazon Linux 2015.03.0+. If you change python to 2.6 and run s3cmd, it should work without problems.

 update-alternatives --set python /usr/bin/python2.6 s3cmd -h 

After running the s3cmd command, you can return python to 2.7 for yum and other utilities:

 update-alternatives --set python /usr/bin/python2.7 yum install <package> 
+18
source
 vi /usr/bin/s3cmd 

add 2.6 to the first line so that it looks like this:

 #!/usr/bin/python2.6 

Save the file and s3cmd will work. if you have / usr / bin / python 2.6 on your system

+9
source

I encountered a similar error with s3cmd, but the module name was different: ImportError: No module named S3.ExitCodes

In my case, I could solve the problem as follows: yum install python-pip and then pip install s3cmd . After that, s3cmd worked fine.

+9
source

None of the previous answers worked for me, but copying multiple lines from sourcegraph aws-cli dockerfile was done:

FROM python: 2
RUN apt-get update -q
RUN apt-get install -qy python-pip groff-base
RUN pip install awscli

0
source

Source: https://habr.com/ru/post/1216294/


All Articles