If the default profile is selected, is it not necessary to unset AWS_PROFILE from environment variable?
$ aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key ****************XXXX shared-credentials-file
secret_key ****************XXXX shared-credentials-file
region ap-northeast-1 config-file ~/.aws/config
$ awsp
AWS Profile Switcher
? Choose a profile default
$ aws configure list
Traceback (most recent call last):
File "/Users/*****/.pyenv/versions/2.7.14/bin/aws", line 27, in <module>
sys.exit(main())
File "/Users/*****/.pyenv/versions/2.7.14/bin/aws", line 23, in main
return awscli.clidriver.main()
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/awscli/clidriver.py", line 59, in main
rc = driver.main()
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/awscli/clidriver.py", line 193, in main
command_table = self._get_command_table()
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/awscli/clidriver.py", line 102, in _get_command_table
self._command_table = self._build_command_table()
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/awscli/clidriver.py", line 122, in _build_command_table
command_object=self)
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/session.py", line 725, in emit
return self._events.emit(event_name, **kwargs)
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/hooks.py", line 356, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/hooks.py", line 228, in emit
return self._emit(event_name, kwargs)
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/hooks.py", line 211, in _emit
response = handler(**kwargs)
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/awscli/customizations/preview.py", line 69, in mark_as_preview
service_name=original_command.service_model.service_name,
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/awscli/clidriver.py", line 314, in service_model
return self._get_service_model()
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/awscli/clidriver.py", line 331, in _get_service_model
api_version = self.session.get_config_variable('api_versions').get(
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/session.py", line 284, in get_config_variable
elif self._found_in_config_file(methods, var_config):
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/session.py", line 311, in _found_in_config_file
return var_config[0] in self.get_scoped_config()
File "/Users/*****/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/session.py", line 388, in get_scoped_config
raise ProfileNotFound(profile=profile_name)
botocore.exceptions.ProfileNotFound: The config profile () could not be found
$ unset AWS_PROFILE
$ aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key ****************XXXX shared-credentials-file
secret_key ****************XXXX shared-credentials-file
region ap-northeast-1 config-file ~/.aws/config