2

I'm using Mac High Sierra. I'm tryhign to install Amazon's S3 cli tools. I thought I had installed successfully through pip, but then I got this error tryihng to run an s3 command ...

localhost:~ davea$ s3cmd --recursive ls s3://sbdasset.springboardonline.com | grep "resource"
-bash: /usr/local/bin/s3cmd: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory

Per the answer here -- pip installation /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory, I tried the recommendation ...

localhost:~ davea$ brew link --overwrite python
Warning: Already linked: /usr/local/Cellar/python/3.7.2_2
To relink: brew unlink python && brew link python

However, then I re-ran the above command and got the same error. None of the other answers in that SO post worked. What else do I need ot check install to get Amazon's S3 cli tools working?

Dave
  • 15,639
  • 133
  • 442
  • 830

2 Answers2

2

I had the same error and ran brew upgrade s3cmd

It did the job for me.

newpoison
  • 914
  • 2
  • 8
  • 20
1

try to open a new terminal and run s3cmd, it maybe env variables missing if not working do one of the following: try to reinstall python

brew install python@2

or install Anaconda https://www.anaconda.com/distribution/#macos then open a new terminal window and try again it should work

Dmitry
  • 220
  • 1
  • 11
  • Hi, I actually already have Python 3.7 installed. When I run "which python," it gives me "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/python" – Dave Feb 26 '19 at 17:40
  • s3cmd does't see it right "/usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory" it is trying to do python2.7. you can install Anaconda and it will overwrite env variables and have your env fixed or you can try to fix it manually unlink /usr/local/opt/python/bin/python2.7 ln -s /usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/python – Dmitry Feb 26 '19 at 18:01
  • When I run "unlink /usr/local/opt/python/bin/python2.7" I got a file not found error. What's the intention there? You want me to unlink Python 2.7 whereever it is installed in my /usr/local dir? – Dave Feb 26 '19 at 18:23
  • yep, but obviously, it is not installed, probably you have it set up in your .bashrc file, check it out that it is not in path otherwise why s3cmd is trying to use it. why don't u install conda it will solve the issue. – Dmitry Feb 26 '19 at 18:34
  • Point of clarity -- is anachonda the same thing as Python 3.7? Per our other question, I do get "Python 3.7" printed out when I run "python --version" – Dave Feb 26 '19 at 20:21
  • Anaconda will reinstall python and fix your env var issue. – Dmitry Feb 26 '19 at 20:22
  • thank you @dmitry , helped me tremendously: https://stackoverflow.com/a/59774110/201657 – jamiet Jan 16 '20 at 16:35