得到"/usr/local/opt/python/bin/python2.7:错误的解释器:没有这样的文件或目录"在Mac上运行S3命令时 [英] Getting "/usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directo" when running S3 command on Mac

查看:120
本文介绍了得到"/usr/local/opt/python/bin/python2.7:错误的解释器:没有这样的文件或目录"在Mac上运行S3命令时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Mac High Sierra.我正在尝试安装Amazon的S3 cli工具.我以为我已经通过pip成功安装了,但是随后出现此错误tryihng来运行s3命令...

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

但是,然后我重新运行了上面的命令,并得到了相同的错误.该SO帖子中的其他答案均无效.我还需要安装其他什么工具才能使Amazon的S3 cli工具正常工作?

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?

推荐答案

尝试打开一个新终端并运行s3cmd,如果不运行,可能缺少env变量,请执行以下一项操作: 尝试重新安装python

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

或安装Anaconda https://www.anaconda.com/distribution/#macos 然后打开一个新的终端窗口,然后重试它应该可以工作

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

这篇关于得到"/usr/local/opt/python/bin/python2.7:错误的解释器:没有这样的文件或目录"在Mac上运行S3命令时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆