我试图在MAC OS X上检查AWS-CLI版本。以下错误回击了:
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /usr/local/aws/bin/python
Reason: image not found
Abort trap: 6
任何有关如何解决此问题的相关意见将不胜感激。
我试图在MAC OS X上检查AWS-CLI版本。以下错误回击了:
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /usr/local/aws/bin/python
Reason: image not found
Abort trap: 6
任何有关如何解决此问题的相关意见将不胜感激。
Answers:
它是awscli的错误,可能会在下一版本中修复。因此,最佳做法是升级:
brew upgrade awscli
brew link --overwrite awscli
,这对我有用。我赞成,因为这是正确道路上的起点。
eb
,可以运行brew upgrade aws-elasticbeanstalk
。
发生此错误的原因是您的虚拟环境的符号链接已损坏。这是从tevino的fix_virtualenv
要旨中得出的一个很好的解决方案:
#!/usr/bin/env bash
ENV_PATH="$(dirname "$(dirname "$(which pip)")")"
SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)"
BAD_ENV_PATHS="/usr/local"
echo "Ensure the root of the broken virtualenv:"
echo " $ENV_PATH"
if [[ -z "$ENV_PATH" ]] || [[ "$ENV_PATH" = *"$BAD_ENV_PATHS"* ]]; then
echo "The root path above doesn't seems to be a valid one."
echo "Please make sure you ACTIVATED the broken virtualenv."
echo "‼️ Exiting for your safety... (thanks @laymonk for reporting this)"
exit 1
fi
read -p "‼️ Press Enter if you are not sure (y/N) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "♻️ Removing old symbolic links......"
find "$ENV_PATH" -type l -delete -print
echo "💫 Creating new symbolic links......"
$SYSTEM_VIRTUALENV "$ENV_PATH"
echo "🎉 Done!"
fi
另外,这是一个类似的问题: Virtualenvs中的引用损坏。
find your-virtual-env-directory -type l -delete
2)通过运行重新创建虚拟环境中的符号链接virtualenv your-virtual-env-directory
OSError: Command /Users/defaultuser/D...o/venv/bin/python3.7 - setuptools pip wheel failed with error code -6
运行命令时出现错误$SYSTEM_VIRTUALENV "$ENV_PATH"
。不知道什么是错误代码“ -6”
阅读主题后,它对我有用:
$ sudo rm -rf /usr/local/aws
$ sudo rm /usr/local/bin/aws
$ brew reinstall awscli
brew reinstall awscli
并且已解决。谢谢
如果您已经安装了python(python --version有效。如果未使用brew install python进行安装)。这个对我有用:
卸载aws
$ sudo rm -rf /usr/local/aws
$ sudo rm /usr/local/bin/aws
重新安装
$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
$ unzip awscli-bundle.zip
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
我通过常规方式卷曲安装了它
$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
然后它停止工作,抱怨找不到 python2.7
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /usr/local/aws/bin/python2.7
Reason: image not found
Abort trap: 6
因此,我按照以下步骤对其进行了修复(如果通过安装了它,请确保不要这样做brew
):
$ sudo rm -rf /usr/local/aws
$ sudo rm /usr/local/bin/aws
然后我使用brew安装它:
$ brew upgrade
$ brew install awscli
brew install some_package
在virtualenv内部时,可能会发生此错误。我认为发生的事情是brew在虚拟机内部工作。要修复它,请从您的virtualenv(rm -rf
虚拟环境文件夹)中停用。然后从头开始重建它。然后发表大声的评论,说不要在虚拟环境中酝酿安装东西。