Repository URL to install this package:
|
Version:
1.21.11 ▾
|
awscli
/
UPGRADE_PY3.md
|
|---|
Python 2.7 was deprecated by the Python Software Foundation back on January 1, 2020 following a multi-year process of phasing it out. Because of this, AWS has deprecated support for Python 2.7, meaning versions the AWS CLI v1 released after the deprecation date no longer work with Python 2.7.
Note
Since the AWS CLI v2 bundles its own copy of Python, this transition only impacts users of the CLI v1. You can upgrade to the AWS CLI v2 to avoid these deprecations in the future.
Going forward, customers using the CLI v1 should transition to using Python 3, with Python 3.6 becoming the minimum by the end of the transition. The deprecation dates for the affected versions of Python are:
| Python version | Deprecation date |
|---|---|
| Python 2.7 | 7/15/2021 |
| Python 3.4 and 3.5 | 2/1/2021 |
The AWS Command Line Interface is built using the Python SDK, so it's affected by this transition. AWS CLI v2 isn't affected by this transition, since it bundles its own copy of Python 3. However, if you still use the AWS CLI v1, you need to decide whether to upgrade to Python 3 or transition to the AWS CLI v2.
Before starting this process, we highly recommend upgrading to AWS CLI v2. This will avoid the requirement for future upgrades and isolate your CLI usage from conflicts with other packages like boto3 and botocore.
First, let’s check if you need to upgrade to Python 3. If you have the AWS CLI installed, you can quickly check which version of Python it’s using with this command.
$ aws --version aws-cli/1.18.191 Python/2.7.18 Darwin/19.6.0 botocore/1.19.31
If the second portion of the version string, starting with Python/ isn’t Python/3.6.x or higher, you should review the options below.
If you’re using the MSI installer, you can simply start using these Python 3 based installers [32 bit] [64 bit].
Otherwise, upgrading Python versions isn’t difficult.
$ python --version Python 3.8.7 $ python3 --version Python 3.8.7 $ python3.8 --version Python 3.8.7
$ python -m pip install awscli
Alternatively, if you're using the bundled installer you can use:
$ python awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
$ aws --version aws-cli/1.18.191 Python/3.8.7 Darwin/19.6.0 botocore/1.19.31
It may be possible that you're unable to upgrade to Python 3. Under these circumstances, you should be prepared for the deprecation date, in order to not be inconvenienced when the time arrives. If you're using a version of the AWS CLI v1 released prior to the deprecation date, it will continue to function after end of support. These versions however will no longer be receiving security or feature updates. If those are required, you will need to migrate to Python 3 to start receiving updates again.
If you install the AWS CLI using pip, as long as you use pip 10.0 and later, you will automatically install the last available version compatible with Python 2.7.
If you installed the AWS CLI v1 using the Windows MSI Installer for Python 3 [32 bit] [64 bit], you're not impacted by this transition. These installers stay up-to-date with each release.
If you're still using the AWS CLI v1 as installed using the Windows MSI Installer for Python 2, be aware that after the deprecation date, the download links for the latest version of the CLI v1 Windows MSI Installer will point to the Python 3 MSIs. Previous releases, including those for Python 2, will remain available at their version-specific URLs:
https://s3.amazonaws.com/aws-cli/AWSCLI32-{VERSION}.msihttps://s3.amazonaws.com/aws-cli/AWSCLI64-{VERSION}.msiIf you use the AWS CLI bundled installer to install the AWS CLI v1 and cannot upgrade,
you will need to ensure you’re downloading a Python 2 compatible version.
All versions released prior to the deprecation date should be compatible.
You can download a specific installer using the URL
https://s3.amazonaws.com/aws-cli/awscli-bundle-{VERSION}.zip,
where "{VERSION}" is the AWS CLI version you wish to install.
For example, you could choose version 1.18.200 using the following command:
curl https://s3.amazonaws.com/aws-cli/awscli-bundle-1.18.200.zip -o awscli-bundle.zip
Once you've downloaded the bundle, proceed with step 2 of the bundle-based installation instructions for your platform: