EB CLIのインストール手順(2022年版)

AWS

基本的にこちらの手順通りです。
https://github.com/aws/aws-elastic-beanstalk-cli-setup

事前準備

Git のインストール

> choco install git

pyenv-win のインストール

GitHub - pyenv-win/pyenv-win: pyenv for Windows. pyenv is a simple python version management tool. It lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.
pyenv for Windows. pyenv is a simple python version management tool. It lets you easily switch between multiple versions...
> choco install pyenv-win
Chocolatey v1.1.0
Installing the following packages:
pyenv-win
By installing, you accept licenses for the packages.
Progress: Downloading pyenv-win 2.64.11... 100%

pyenv-win v2.64.11 [Approved]
pyenv-win package files install completed. Performing other installation steps.
The package pyenv-win wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): A

Attempt to use original download file name failed for 'C:\ProgramData\chocolatey\lib\pyenv-win\tools/pyenv-win.zip'.
Copying pyenv-win
  from 'C:\ProgramData\chocolatey\lib\pyenv-win\tools/pyenv-win.zip'
Hashes match.
Extracting C:\Users\user\AppData\Local\Temp\chocolatey\pyenv-win\2.64.11\pyenv-winInstall.zip to C:\Users\user\.pyenv\...
C:\Users\user\.pyenv\
PATH environment variable does not have %USERPROFILE%\.pyenv\pyenv-win\bin in it. Adding...
PATH environment variable does not have %USERPROFILE%\.pyenv\pyenv-win\shims in it. Adding...
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 The install of pyenv-win was successful.
  Software installed to 'C:\Users\user\.pyenv\'

Chocolatey installed 1/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

PowerShellで下記のコマンドを実行して環境変数を追加

[System.Environment]::SetEnvironmentVariable('PYENV',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")

[System.Environment]::SetEnvironmentVariable('PYENV_ROOT',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")

[System.Environment]::SetEnvironmentVariable('PYENV_HOME',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")

下記も実行したけど、後で2重になっていることに気付いて削除したのでやらなくていいかも。

[System.Environment]::SetEnvironmentVariable('path', $env:USERPROFILE + "\.pyenv\pyenv-win\bin;" + $env:USERPROFILE + "\.pyenv\pyenv-win\shims;" + [System.Environment]::GetEnvironmentVariable('path', "User"),"User")

環境変数は下記で確認できる。
[設定]-[システム]-[バージョン情報]-[システムの詳細設定]-[環境変数]

pyenvのバージョンを確認

> pyenv --version
pyenv 2.64.11

Python のインストール

インストールできるPythonのバージョンを確認

> pyenv install --list

Pythonのバージョンを指定してインストール

> pyenv install 3.9.6

使用するPythonのバージョンを設定

> pyenv global 3.9.6

設定されているPythonのバージョンを確認

> pyenv versions
* 3.9.6 (set by C:\Users\user\.pyenv\pyenv-win\version)

virtualenv のインストール

> pip install virtualenv

EB CLI のインストール

リポジトリーをクローン

> git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git

インストーラーを実行

> python .\aws-elastic-beanstalk-cli-setup\scripts\ebcli_installer.py

***********************************
1. Locating virtualenv installation
***********************************

******************************************
2. Creating exclusive virtualenv for EBCLI
******************************************
created virtual environment CPython3.9.6.final.0-64 in 5643ms
  creator CPython3Windows(dest=C:\Users\user\.ebcli-virtual-env, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\user\AppData\Local\pypa\virtualenv)
    added seed packages: pip==22.2.2, setuptools==65.3.0, wheel==0.37.1
  activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

************************
3. Activating virtualenv
************************

*******************
4. Installing EBCLI
*******************
Collecting awsebcli
  Downloading awsebcli-3.20.3.tar.gz (259 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 259.2/259.2 kB 3.2 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting botocore<1.24.0,>1.23.41
  Downloading botocore-1.23.54-py3-none-any.whl (8.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.5/8.5 MB 4.3 MB/s eta 0:00:00
Collecting cement==2.8.2
  Downloading cement-2.8.2.tar.gz (165 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 165.8/165.8 kB 5.0 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting colorama<0.4.4,>=0.2.5
  Downloading colorama-0.4.3-py2.py3-none-any.whl (15 kB)
Collecting future<0.17.0,>=0.16.0
  Downloading future-0.16.0.tar.gz (824 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 824.5/824.5 kB 4.7 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting pathspec==0.9.0
  Downloading pathspec-0.9.0-py2.py3-none-any.whl (31 kB)
Collecting python-dateutil<3.0.0,>=2.1
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 5.1 MB/s eta 0:00:00
Collecting requests<=2.26,>=2.20.1
  Downloading requests-2.26.0-py2.py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.3/62.3 kB ? eta 0:00:00
Requirement already satisfied: setuptools>=20.0 in c:\users\user\.ebcli-virtual-env\lib\site-packages (from awsebcli) (65.3.0)
Collecting semantic_version==2.8.5
  Downloading semantic_version-2.8.5-py2.py3-none-any.whl (15 kB)
Collecting six<1.15.0,>=1.11.0
  Downloading six-1.14.0-py2.py3-none-any.whl (10 kB)
Collecting termcolor==1.1.0
  Downloading termcolor-1.1.0.tar.gz (3.9 kB)
  Preparing metadata (setup.py) ... done
Collecting wcwidth<0.2.0,>=0.1.7
  Downloading wcwidth-0.1.9-py2.py3-none-any.whl (19 kB)
Collecting PyYAML<5.5,>=5.3.1
  Downloading PyYAML-5.4.1-cp39-cp39-win_amd64.whl (213 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 213.4/213.4 kB 4.3 MB/s eta 0:00:00
Collecting urllib3>=1.26.5
  Downloading urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.4/140.4 kB 4.2 MB/s eta 0:00:00
Collecting pypiwin32==223
  Downloading pypiwin32-223-py3-none-any.whl (1.7 kB)
Collecting pywin32>=223
  Downloading pywin32-304-cp39-cp39-win_amd64.whl (12.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.2/12.2 MB 3.6 MB/s eta 0:00:00
Collecting jmespath<1.0.0,>=0.7.1
  Downloading jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Collecting charset-normalizer~=2.0.0
  Downloading charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Collecting certifi>=2017.4.17
  Downloading certifi-2022.6.15-py3-none-any.whl (160 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.2/160.2 kB 4.8 MB/s eta 0:00:00
Collecting idna<4,>=2.5
  Downloading idna-3.3-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 kB 3.2 MB/s eta 0:00:00
Building wheels for collected packages: awsebcli, cement, termcolor, future
  Building wheel for awsebcli (setup.py) ... done
  Created wheel for awsebcli: filename=awsebcli-3.20.3-py3-none-any.whl size=363046 sha256=8480d113217ffeddd8a7442c5f9347f567de5cb1eb3de31411c45c0f0d3e4c88
  Stored in directory: c:\users\user\appdata\local\pip\cache\wheels\53\a5\e0\fab45c199fdf641ecf356dbad7c0496d81176702ba33900c7d
  Building wheel for cement (setup.py) ... done
  Created wheel for cement: filename=cement-2.8.2-py3-none-any.whl size=99504 sha256=5441b6c174e982d85ecbd29adb8d618b47f2491ac66463ae319b45bf792d73ac
  Stored in directory: c:\users\user\appdata\local\pip\cache\wheels\85\d0\bd\0b0c9c00b98cc56399892889b9be920c7f5dc39fc812712a16
  Building wheel for termcolor (setup.py) ... done
  Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4832 sha256=a0a77bbde6e00926082f1741b9a4621db08a67f028b95cf7af2721b67611a186
  Stored in directory: c:\users\user\appdata\local\pip\cache\wheels\b6\0d\90\0d1bbd99855f99cb2f6c2e5ff96f8023fad8ec367695f7d72d
  Building wheel for future (setup.py) ... done
  Created wheel for future: filename=future-0.16.0-py3-none-any.whl size=487793 sha256=7f7948b063152b97c386d5fc0f9150c1a31caffb1b4c0acb5be19ed8d5029a92
  Stored in directory: c:\users\user\appdata\local\pip\cache\wheels\6e\bc\19\ea1496b17b60d45b1503dfb87704b1246bfaca822ce9880fd9
Successfully built awsebcli cement termcolor future
Installing collected packages: wcwidth, termcolor, pywin32, future, cement, urllib3, six, semantic_version, PyYAML, pypiwin32, pathspec, jmespath, idna, colorama, charset-normalizer, certifi, requests, python-dateutil, botocore, awsebcli
Successfully installed PyYAML-5.4.1 awsebcli-3.20.3 botocore-1.23.54 cement-2.8.2 certifi-2022.6.15 charset-normalizer-2.0.12 colorama-0.4.3 future-0.16.0 idna-3.3 jmespath-0.10.0 pathspec-0.9.0 pypiwin32-223 python-dateutil-2.8.2 pywin32-304 requests-2.26.0 semantic_version-2.8.5 six-1.14.0 termcolor-1.1.0 urllib3-1.26.12 wcwidth-0.1.9

***********************
5. Creating EB wrappers
***********************

***************
6. Finishing up
***************
Success!


To complete installation, ensure `eb` is in PATH. You can ensure this by executing:


    1. CMD Prompt:

        cmd.exe /c "C:\Users\user\.ebcli-virtual-env\executables\path_exporter.bat"

    2. PowerShell:

        & "C:\Users\user\.ebcli-virtual-env\executables\path_exporter.vbs"


NOTE: Additionally, you would need to **restart this shell**

pathの追加

コマンドプロンプトを起動して下記のコマンドを実行します。

> cmd.exe /c "C:\Users\user\.ebcli-virtual-env\executables\path_exporter.bat"

EB CLI のバージョンを確認

> eb --version
EB CLI 3.20.3 (Python 3.9.6)

コメント

タイトルとURLをコピーしました