NetBSD/amd64에서 소스 코드로awscliv2 설치

AWS 공식 설치 프로그램(\63;)있긴 있는데...
AWS CLI 버전 2 설치, 업데이트, 제거 - AWS Command Line Interface
Docker, Linux(x86 64 or arch64), macOS, Windows 이외의 환경에서는 소스 코드만 지원됩니다.

컨디션


% uname -rsm
NetBSD 9.0 amd64

차리다


awscliv2는pythn3.7이상이 필요합니다.
https://github.com/aws/aws-cli/blob/v2/CHANGELOG.rst#200
breaking-change:python: Removed support for older Python runtimes. AWS CLI V2 officially supports Python 3.7+. See #3588, #4901.
따라서python 3.7을 설치합니다.
/etc/mk.conf에 다음을 추가합니다.
PYTHON_VERSION_DEFAULT=37
설치.
% cd /usr/pkgsrc/lang/python
% sudo make update clean clean-depends

awscli 설치


설치
% sudo pip3.7 install https://github.com/aws/aws-cli/archive/v2.tar.gz
% sudo pip3.7 install https://github.com/boto/botocore/archive/v2.tar.gz
또는 이렇게.근데 git가 필요해.
% sudo pip3.7 install -e git://github.com/aws/aws-cli.git@v2#egg=awscli
% sudo pip3.7 install -e git://github.com/boto/botocore.git@v2#egg=botocore
실행 중 오류가 발생했습니다.
% aws --version
Traceback (most recent call last):
  File "/usr/pkg/bin/aws", line 19, in <module>
    import awscli.clidriver
  File "/usr/pkg/lib/python3.7/site-packages/awscli/clidriver.py", line 58, in <module>
    from awscli.autoprompt.core import AutoPromptDriver
  File "/usr/pkg/lib/python3.7/site-packages/awscli/autoprompt/core.py", line 16, in <module>
    from awscli.autoprompt.prompttoolkit import PromptToolkitPrompter
  File "/usr/pkg/lib/python3.7/site-packages/awscli/autoprompt/prompttoolkit.py", line 25, in <module>
    from awscli.autocomplete.local import model
  File "/usr/pkg/lib/python3.7/site-packages/awscli/autocomplete/local/model.py", line 20, in <module>
    from awscli.autocomplete import db
  File "/usr/pkg/lib/python3.7/site-packages/awscli/autocomplete/db.py", line 3, in <module>
    import sqlite3
  File "/usr/pkg/lib/python3.7/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/pkg/lib/python3.7/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
아마 이거겠지.
% cd /usr/pkgsrc/databases/py-sqlite3
% sudo make update clean clean-depends
잠시 완성했습니다.
% aws --version
aws-cli/2.1.7 Python/3.7.2 NetBSD/9.0 source/amd64 prompt/off

참고 자료

  • pip에서 AWS CLI v2를 설치해 보았습니다.IO
  • AWS CLI v2 development | AWS Developer Blog
  • 좋은 웹페이지 즐겨찾기