Unable to load AWS_CREDENTIAL_FILE #2134

Open
SilenceTeng opened this Issue Feb 28, 2014 · 3 comments

Comments

Projects
None yet
4 participants
@SilenceTeng

Unable to load AWS_CREDENTIAL_FILE
Failure: NoneType object is not callable.

@danielgtaylor

This comment has been minimized.

Show comment Hide comment
@danielgtaylor

danielgtaylor Mar 17, 2014

Owner

Do you have a code sample and maybe some information about your environment? What operating system are you using? What version of Python? What is in ~/.boto or ~/.aws, if anything?

Owner

danielgtaylor commented Mar 17, 2014

Do you have a code sample and maybe some information about your environment? What operating system are you using? What version of Python? What is in ~/.boto or ~/.aws, if anything?

@RichardForshaw

This comment has been minimized.

Show comment Hide comment
@RichardForshaw

RichardForshaw Mar 27, 2015

I have had the same problem. Using boto3 on python 2.7.3.

Boto3 was not finding my ~/.aws/credentials file. I did some python debugging and found that the code is using the os.path.expanduser function if it reads the file location from the AWS_CREDENTIAL_FILE environment variable (which is in fact redundant because the shell should perform the tilde-expansion when the variable is exported), but it is NOT using the expanduser function when it reverts to the default values defined in Session.SessionVariables.

SessionVariables is also inconsistent because it does not list an environment variable for the credentials file location. I also think the boto3 docs are a little behind on describing these settings.

I suggest that the expanduser function is used consistently and environment variables are provided consistently.

Cheers

I have had the same problem. Using boto3 on python 2.7.3.

Boto3 was not finding my ~/.aws/credentials file. I did some python debugging and found that the code is using the os.path.expanduser function if it reads the file location from the AWS_CREDENTIAL_FILE environment variable (which is in fact redundant because the shell should perform the tilde-expansion when the variable is exported), but it is NOT using the expanduser function when it reverts to the default values defined in Session.SessionVariables.

SessionVariables is also inconsistent because it does not list an environment variable for the credentials file location. I also think the boto3 docs are a little behind on describing these settings.

I suggest that the expanduser function is used consistently and environment variables are provided consistently.

Cheers

@hteleb

This comment has been minimized.

Show comment Hide comment
@hteleb

hteleb Dec 30, 2016

Hi there,

please, pardon me if my question is naive, am newbie to python. by following aws doc to read aws credentials from env variable as follows, getting error below? any idea?!

/**** python code

import boto
from boto import ec2
ec2 = boto.ec2.connect_to_region('us-east-1', profile_name='profilename')

******/

error:

C:\Users\username.thonny\Python35\site-packages\boto\pyami\config.py:69: UserWarning: Unable to load AWS_CREDENTIAL_FILE (C:\Users\username.aws\credential.txt)
warnings.warn('Unable to load AWS_CREDENTIAL_FILE (%s)' % full_path)

hteleb commented Dec 30, 2016

Hi there,

please, pardon me if my question is naive, am newbie to python. by following aws doc to read aws credentials from env variable as follows, getting error below? any idea?!

/**** python code

import boto
from boto import ec2
ec2 = boto.ec2.connect_to_region('us-east-1', profile_name='profilename')

******/

error:

C:\Users\username.thonny\Python35\site-packages\boto\pyami\config.py:69: UserWarning: Unable to load AWS_CREDENTIAL_FILE (C:\Users\username.aws\credential.txt)
warnings.warn('Unable to load AWS_CREDENTIAL_FILE (%s)' % full_path)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment