我无法将AWS SAM CLI从0.2.8升级到0.6.1。
我遵循此处提到的指示: https://github.com/awslabs/aws-sam-cli/blob/develop/docs/installation.rst
$ sam -version
A newer version of the AWS SAM CLI is available!
Your version: 0.2.8
Latest version: 0.6.1
See https://github.com/awslabs/aws-sam-local for upgrade instructions
sam version 0.2.8
按照说明删除旧版本
$ npm uninstall -g aws-sam-local
up to date in 0.044s
$ python --version
Python 3.6.5
$ pip --version
pip 18.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
$ pip install --user aws-sam-cli
Requirement already satisfied: aws-sam-cli in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (0.6.1)
Requirement already satisfied: boto3~=1.5 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from aws-sam-cli) (1.9.34)
Requirement already satisfied: cookiecutter~=1.6.0 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from aws-sam-cli) (1.6.0)
Requirement already satisfied: dateparser~=0.7 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from aws-sam-cli) (0.7.0)
Requirement already satisfied: click~=6.7 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from aws-sam-cli) (6.7)
Requirement already satisfied: Flask~=1.0.2 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from aws-sam-cli) (1.0.2)
Requirement already satisfied: python-dateutil~=2.6 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from aws-sam-cli) (2.6.1)
Requirement already satisfied: aws-sam-translator==1.7.0 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from aws-sam-cli) (1.7.0)
Requirement already satisfied: six~=1.11.0 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from aws-sam-cli) (1.11.0)
Requirement already satisfied: PyYAML~=3.12 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from aws-sam-cli) (3.12)
Requirement already satisfied: docker>=3.3.0 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from aws-sam-cli) (3.5.1)
Requirement already satisfied: chevron~=0.12 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from aws-sam-cli) (0.13.1)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from boto3~=1.5->aws-sam-cli) (0.9.3)
Requirement already satisfied: botocore<1.13.0,>=1.12.34 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from boto3~=1.5->aws-sam-cli) (1.12.34)
Requirement already satisfied: s3transfer<0.2.0,>=0.1.10 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from boto3~=1.5->aws-sam-cli) (0.1.13)
Requirement already satisfied: poyo>=0.1.0 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from cookiecutter~=1.6.0->aws-sam-cli) (0.4.2)
Requirement already satisfied: jinja2-time>=0.1.0 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from cookiecutter~=1.6.0->aws-sam-cli) (0.2.0)
Requirement already satisfied: jinja2>=2.7 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from cookiecutter~=1.6.0->aws-sam-cli) (2.10)
Requirement already satisfied: requests>=2.18.0 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from cookiecutter~=1.6.0->aws-sam-cli) (2.20.0)
Requirement already satisfied: future>=0.15.2 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from cookiecutter~=1.6.0->aws-sam-cli) (0.17.1)
Requirement already satisfied: binaryornot>=0.2.0 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from cookiecutter~=1.6.0->aws-sam-cli) (0.4.4)
Requirement already satisfied: whichcraft>=0.4.0 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from cookiecutter~=1.6.0->aws-sam-cli) (0.5.2)
Requirement already satisfied: tzlocal in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from dateparser~=0.7->aws-sam-cli) (1.5.1)
Requirement already satisfied: regex in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from dateparser~=0.7->aws-sam-cli) (2018.8.29)
Requirement already satisfied: pytz in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from dateparser~=0.7->aws-sam-cli) (2018.7)
Requirement already satisfied: itsdangerous>=0.24 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from Flask~=1.0.2->aws-sam-cli) (1.1.0)
Requirement already satisfied: Werkzeug>=0.14 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from Flask~=1.0.2->aws-sam-cli) (0.14.1)
Requirement already satisfied: jsonschema~=2.6 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from aws-sam-translator==1.7.0->aws-sam-cli) (2.6.0)
Requirement already satisfied: websocket-client>=0.32.0 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from docker>=3.3.0->aws-sam-cli) (0.53.0)
Requirement already satisfied: docker-pycreds>=0.3.0 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from docker>=3.3.0->aws-sam-cli) (0.3.0)
Requirement already satisfied: docutils>=0.10 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from botocore<1.13.0,>=1.12.34->boto3~=1.5->aws-sam-cli) (0.14)
Requirement already satisfied: urllib3<1.25,>=1.20; python_version >= "3.4" in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from botocore<1.13.0,>=1.12.34->boto3~=1.5->aws-sam-cli) (1.24)
Requirement already satisfied: arrow in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from jinja2-time>=0.1.0->cookiecutter~=1.6.0->aws-sam-cli) (0.12.1)
Requirement already satisfied: MarkupSafe>=0.23 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from jinja2>=2.7->cookiecutter~=1.6.0->aws-sam-cli) (1.0)
Requirement already satisfied: idna<2.8,>=2.5 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from requests>=2.18.0->cookiecutter~=1.6.0->aws-sam-cli) (2.7)
Requirement already satisfied: certifi>=2017.4.17 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from requests>=2.18.0->cookiecutter~=1.6.0->aws-sam-cli) (2018.10.15)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/nicolasjourdain/Library/Python/3.6/lib/python/site-packages (from requests>=2.18.0->cookiecutter~=1.6.0->aws-sam-cli) (3.0.4)
我已添加到.bash_profile
USER_BASE_PATH=$(python -m site --user-base)
export PATH=$PATH:$USER_BASE_PATH/bin
$ sam --version
A newer version of the AWS SAM CLI is available!
Your version: 0.2.8
Latest version: 0.6.1
See https://github.com/awslabs/aws-sam-local for upgrade instructions
sam version 0.2.8
哦,不!所有这一切都不起作用! 请帮忙! 我想念什么?
$ which sam
/usr/local/bin/sam
$ echo $PATH
/usr/local/opt/python/libexec/bin:~/apache-maven-3.5.4/bin:~/mongodb-osx-x86_64-enterprise-4.0.0/bin:/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin:/Users/nicolasjourdain/Library/Python/2.7/bin
答案 0 :(得分:0)
现在的最新版本是v0.40.0
您可以在此处根据您的操作系统找到最新的说明。 https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html
答案 1 :(得分:0)
要在Mac OS中使用brew升级sam-cli的本地版本,您必须运行以下命令:
$ brew upgrade aws-sam-cli