python:3.6.2 ๊ธฐ๋ฐ Docker ์ปจํ
์ด๋์ awscli==1.13.0
๋ฅผ ์ค์นํ ํ aws ๋ช
๋ น์ ์คํํ๋ฉด ๋ค์์ด ๋ฐํ๋ฉ๋๋ค.
Traceback (most recent call last):
File "/usr/local/bin/aws", line 19, in <module>
import awscli.clidriver
File "/usr/local/lib/python3.6/site-packages/awscli/clidriver.py", line 24, in <module>
from botocore.history import get_global_history_recorder
ModuleNotFoundError: No module named 'botocore.history'
awscli==1.12.0
๋๋ ธ๊ณ ๋ชจ๋ ๊ฒ์ด ์ ์๋ํฉ๋๋ค.
cli์ botocore ๋ฒ์ ์ด ๋๊ธฐํ๋์ง ์์ ๊ฒ์ฒ๋ผ ๋ค๋ฆฝ๋๋ค. awscli v1.13.0์ ๊ฒฝ์ฐ ์ต์ํ botocore v1.8.3์ด ์์ด์ผ ํฉ๋๋ค.
๋๊ฐ์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
```[LOCAL][ fcabral@droideka :~]$ sudo pip freeze | egrep '(awscli|boto|boto3|botocore)'
awscli==1.14.5
๋ณดํ ==2.48.0
๋ณดํ 3==1.4.8
๋ณดํ ์ฝ์ด==1.8.9
```[LOCAL][fcabral<strong i="12">@droideka</strong>:~]$ aws help
Traceback (most recent call last):
File "/usr/local/bin/aws", line 19, in <module>
import awscli.clidriver
File "/usr/local/lib/python2.7/dist-packages/awscli/clidriver.py", line 24, in <module>
from botocore.history import get_global_history_recorder
ImportError: No module named history
@karimtabet์ด ๋งํ๋ฏ์ด 1.12.0์ผ๋ก ๋๋๋ฆฌ๋ฉด ์๋ํฉ๋๋ค.
@cabral404 ์ ์ ํํ ๊ฐ์ ์ค๋ฅ: ๋ค์์ ์ฌ์ฉํฉ๋๋ค.
aws-cli/1.14.6
๋ณดํ ์ฝ์ด/1.8.12
ํ์ด์ฌ/2.7.12
๋ด ์ฌ์ฉ์์ ํจ๊ป ์คํํ ๋ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค. sudo๋ฅผ ์ฌ์ฉํ๋ฉด aws cli๊ฐ ์ ๋๋ก ์คํ๋์ง๋ง ํจํค์ง ๋๋ pip์์ ์ค์นํ ๋ ๊ถํ ๋ฌธ์ ๊ฐ ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
๋ด ํด๊ฒฐ ๋ฐฉ๋ฒ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
pip uninstall awscli
pip์์ aws cli ์ ๊ฑฐpackman -R aws-cli
)curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
./awscli-bundle/install -b ~/bin/aws
export PATH=~/bin:$PATH
์์ธํ ์ ๋ณด๋ http://docs.aws.amazon.com/cli/latest/userguide/awscli-install-bundle.html#install -bundle-user์ ์์ต๋๋ค.
์ด์ ๋ฒ์ ์ผ๋ก ๋๋๋ฆฌ๋ ๊ฒ์ ์๋ํ ์ ์์ง๋ง ๊ฐ์ ธ์ค๊ธฐ ์คํจ๋ก ์ธํด ์๋ํ์ง ์๋ ์ต์ ๋ฒ์ ์ awscli
ํจํค์ง๊ฐ ์ค์น๋ ๋ฐฉ๋ฒ์ด๋ ์์คํ
์์ ์ผ๋ฐ์ ์ผ๋ก Python ํจํค์ง๋ฅผ ๊ด๋ฆฌํ๋ ๋ฐฉ๋ฒ๊ณผ ๊ด๋ จ๋ ๋ฌธ์ ์ฒ๋ผ ๋ค๋ฆฝ๋๋ค. ์ด ๊ฒฝ์ฐ pip freeze
์ ์ถ๋ ฅ์ ํ์๋๋ ๋ฒ์ ๋ณด๋ค ์ฐ์ ํ๋ ๋ค๋ฅธ ๋ฒ์ ์ botocore๊ฐ ์ด๋๊ฐ์ ์์ ๊ฒ์
๋๋ค.
@Danpiel์ด ๋ค๋ฅธ ๋ชจ๋ ์ค์น ๋ฐฉ๋ฒ์ ์ ๊ฑฐํ๊ณ ๋ฒ๋ค ์ค์น ํ๋ก๊ทธ๋จ์ ์ฌ์ฉํ๋ ๊ฒ์ด ๊ฒฉ๋ฆฌ๋ virtualenv๋ฅผ ์ฌ์ฉํ์ฌ aws cli๋ฅผ ์คํํ๊ธฐ ๋๋ฌธ์ ๊ฐ๋ฅํ ์๋ฃจ์ ์ด๋ผ๊ณ ์ธ๊ธํ์ต๋๋ค.
์ฌ์ ํ ์ด ๋ฌธ์ ๋ฅผ ๊ฒช๊ณ ์๋ ์ฌ๋์ ์ํด ๋ค์์ ์ ๊ณตํ์ธ์.
1) ์ด๋ค ์ด์ ์ฒด์ ๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๊น?
2) awscli
ํจํค์ง๋ ์ด๋ป๊ฒ ์ค์นํ์
จ๋์?
3) awscli
ํจํค์ง๋ฅผ ์ด๋ป๊ฒ ์
๋ฐ์ดํธ ํด๋ณด์
จ๋์?
์ด๊ฒ์ ๋๋ฅผ ์ํด ๊ณ ์ณค์ต๋๋ค.
$ sudo -H pip install awscli --upgrade
aws ec2 describe-regions --query 'Regions[].{Name:RegionName}' --output text --region us-east-1
Traceback (most recent call last):
File "/usr/bin/aws", line 19, in <module>
import awscli.clidriver
File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 24, in <module>
from botocore.history import get_global_history_recorder
ImportError: No module named history
๋๋ ๋ํ ๊ฐ์ ๋ฌธ์ ์ ์ง๋ฉดํ๊ณ ์์ต๋๋ค.
@optimisticanshul๊ณผ ๊ฐ์ ๋ฌธ์
AWS ๋ฒ์ : awscli-1.14.19
botocore: botocore-1.8.23
ํ์ด์ฌ: ํ์ด์ฌ 2.7.13
ํด๊ฒฐ ๋ฐฉ๋ฒ:
pip uninstall boto3 -y
pip uninstall boto -y
pip uninstall botocore -y
pip install botocore --upgrade
๊ฒฐ๊ณผ AWS ์๋
๋๋ ๋น์ทํ ๋ฌธ์ ์ ์ง๋ฉดํ๊ณ ์์ต๋๋ค. ์ฐจ์ด์ ์ ๋ฃจํธ ์ฌ์ฉ์๋ก ์ก์ธ์คํ๋ ค๊ณ ํ๋ฉด ์ค๋ฅ๊ฐ ๋ฐ์ํ์ง๋ง ec2-user๋ก ์ก์ธ์คํ๋ฉด ์ ๋๋ก ์๋ํ๋ค๋ ๊ฒ์ ๋๋ค.
ec2-user๋ก ์ถ๋ ฅ
[ec2-user@ip-x-x-x-x ~]$ aws route53 change-resource-record-sets --hosted-zone-id $PrivateHostedZoneId --change-batch file:///home/ec2-user/change.json
{
"ChangeInfo": {
"Status": "PENDING",
"Comment": "Create route53 DNS entry at instance boot up",
"SubmittedAt": "2018-01-17T12:30:45.534Z",
"Id": "/change/C1IG3ETCO6MGVW"
}
}
๋ฃจํธ ์ฌ์ฉ์๋ก ์ถ๋ ฅ
[root@ip-x-x-x-x ec2-user]# aws route53 change-resource-record-sets --hosted-zone-id $PrivateHostedZoneId --change-batch file:///home/ec2-user/change.json
Traceback (most recent call last):
File "/usr/bin/aws", line 19, in <module>
import awscli.clidriver
File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 24, in <module>
from botocore.history import get_global_history_recorder
ImportError: No module named history
AWS CLI: 1.14.9
ํ์ด์ฌ: 2.7.12
๋ฆฌ๋
์ค: 4.9.76-3.78.amzn1.x86_64
๋ณดํ ์ฝ์ด: 1.8.13
๋ํ ๊ฐ์ ๋ฌธ์ ๋ฅผ ๋ด ๋๋ค.
๋ฆฌ๋
์ค: ์์น ๋ฆฌ๋
์ค
ํ์ด์ฌ: 3.6.4
aws-cli 1.14.40-1
๋ณดํ ์ฝ์ด: 1.8.44-1
pip๋ฅผ ํตํด botocore๋ฅผ ์ ๊ทธ๋ ์ด๋ํ๋ ค๊ณ ์๋ํ์ง๋ง ์ง๊ธ๊น์ง ์คํจํ์ต๋๋ค.
์
๋ฐ์ดํธ: #641์ ์ธ๊ธ๋ sudo pip install awscli --force-reinstall --upgrade
๋ ์๋ํ์ง๋ง ์ญ์ ๋์์ด ๋์ง ์์์ต๋๋ค.
Windows๋ฅผ ์ฌ์ฉํ๋ ๋์ผํ ๋ฌธ์ :
ํ๋ซํผ: win32
ํ์ด์ฌ: 3.5.2
awscli: 1.14.41
๋ณดํ ์ฝ์ด: 1.8.45
awscli ๋ฐ botocore๋ฅผ ์ ๊ฑฐํ๊ณ ๋ค์ ์ค์นํ์ฌ ์์์ ์ ์ํ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์๋ํ์ง๋ง ์ฌ์ ํ ๋ค์ ๋ฉ์์ง๊ฐ ํ์๋ฉ๋๋ค.
File "C:\python\Python3\Scripts\aws.cmd", line 50, in <module>
import awscli.clidriver
ImportError: No module named awscli.clidriver
pip๊ฐ ์๋ ๋ค๋ฅธ ๋ฉ์ปค๋์ฆ(์: linux ํจํค์ง ๊ด๋ฆฌ์)์ ํตํด CLI๋ฅผ ์ค์นํ ๊ฒฝ์ฐ ๋ค์ ์ค์นํ๊ธฐ ์ ์ ์์คํ ์ ์ ๋ฆฌํ๊ธฐ ์ํด CLI๋ ์ ๊ฑฐํด์ผ ํฉ๋๋ค. Windows์ ๊ฒฝ์ฐ ์ฌ๊ธฐ์์ ์ ๊ณตํ๋ ์ค์น ํ๋ก๊ทธ๋จ์ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
์ฌ๊ธฐ์์๋ ๋์ผํ์ง๋ง ์
๊ทธ๋ ์ด๋๋ก ์์ ๋์์ต๋๋ค.
์คํจํ ๊ฒ๋ค
boto (2.48.0)
boto3 (1.4.7)
botocore (1.7.1)
pip install --upgrade boto3
pip install --upgrade botocore
pip install --upgrade awscli
```
AWS ECS ๋ชฉ๋ก ์ปจํ
์ด๋ ์ธ์คํด์ค --cluster my_ecs_cluster
{
"containerInstanceArns": [
...
]
}
๋๋ถ๋ถ์ ์ต์ ๋ฒ์ ์์ ์ฌ์ ํ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
awscli==1.14.53
๋ณดํ ==2.48.0
๋ณดํ 3==1.6.6
๋ณดํ ์ฝ์ด==1.9.6
๋ช
๋ น: aws ecr get-login --region $AWS_DEFAULT_REGION
์ด๋ฏธ์ง: ์ฐ๋ถํฌ - aws/codebuild/ docker:17.09.0
์ญ์ถ์ (๊ฐ์ฅ ์ต๊ทผ ํธ์ถ ๋ง์ง๋ง):
ํ์ผ "/usr/local/bin/aws", 19ํ,
awscli.clidriver ๊ฐ์ ธ์ค๊ธฐ
ํ์ผ "/usr/local/lib/python2.7/dist-packages/awscli/clidriver.py", 24ํ,
botocore.history์์ ๊ฐ์ ธ์ค๊ธฐ get_global_history_recorder
ImportError: history๋ผ๋ ๋ชจ๋์ด ์์ต๋๋ค.
์๋ํ๋ ์๋ฃจ์
์ ์ฐพ์์ต๋๋ค.
awscli==1.11.157
๋ณดํ 3==1.6.7
๋ณดํ ์ฝ์ด==1.9.7
์์ ์ฌํญ์ด ์ ์ฉ๋๊ณ boto3 ๋ฐ botocore ๋ฒ์ ์ด ์ ๋ฐ์ดํธ๋ ๊ฒ ๊ฐ์ต๋๋ค. ์ ๋ฐ์ดํธ๊ฐ ๋ฌด์์ด๋ ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋ ๊ฒ ๊ฐ์ต๋๋ค.
๊ตฌ์ฑ ํ์ผ์ ๊ตฌ๋ฌธ ๋ถ์ํ ์ ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ์ ~/.aws/config ํ์ผ์ ์์ฑํ์ฌ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
yum์ผ๋ก ์ค์นํ๋ CentOS์์๋ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค. yum์ผ๋ก ํจํค์ง๋ฅผ ์ ๊ฑฐํ๊ณ pip๋ก awscli๋ฅผ ์ค์นํ๋๋ฐ ์ด์ ๋ชจ๋ ๊ฒ์ด ์ ๋๋ก ์๋ํฉ๋๋ค.
centos 7์์ epel๋ก ์ค์นํ๋ ๊ฒฝ์ฐ awscli๊ฐ epel์์ ์ ๊ฑฐ๋๊ณ centos base repo์ ํฌํจ๋์์ต๋๋ค. ๊ทธ๋ฌ๋ ์ข ์์ฑ์ด ๋ณ๊ฒฝ๋๋ฉด ๋ค์ ํจํค์ง๋ฅผ ์ ๊ฑฐํ์ญ์์ค(๋ค๋ฅธ ๊ฒ์ด ์ฌ์ฉํ์ง ์๋ ๊ฒฝ์ฐ)
python2-s3transfer python-colorama python2-botocore python2-rsa
๊ทธ๋ฐ ๋ค์ centos-base repo์์ ๋ค์ ์ค์นํ์ญ์์ค.
์ค๋๋ ๋ฌธ์ ๋ฅผ ์ข ๋ฃํฉ๋๋ค. ์ธ๊ธํ๋ฏ์ด ๋ฌธ์ ๋ CLI์ ํจ๊ป ์ฌ์ฉ๋๋ ์ด์ ๋ฒ์ ์ botocore๋ก ์ธํด ๋ฐ์ํฉ๋๋ค. pip ๋๋ ๊ธฐํ ์ง์๋๋ ์ค์น ๋ฐฉ๋ฒ์ ํตํด
botocore ํจํค์ง ์ ๊ฑฐ
ํ ์ ๊ฑฐ botocore
awscli๋ฅผ ๋ค์ ์ค์น
pip ์ค์น awscli
์ด์ ๋๋ฅผ ์ํด ์ผํฉ๋๋ค.
sudo -H pip ์ค์น awscli --upgrade
@mariosotil ๋น์ ์ด ์ฐ๋ฆฌ๋ฅผ ๊ตฌํ์ต๋๋ค!
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ด๊ฒ์ ๋๋ฅผ ์ํด ๊ณ ์ณค์ต๋๋ค.
$ sudo -H pip install awscli --upgrade