如何在bash_profile中自动加载

时间:2014-06-25 21:57:37

标签: python bash python-2.7

嗨我的.bash_profile中有各种各样的键:

ex export blah=blahblah

然而,当我尝试在python中访问它们时:

from os import getenv
aws_access_key_id=getenv('AWS_ACCESS_KEY');

我收到以下错误:

File "/Users/tai/Documents/workspace/testSelenium/testS/database.py", line 25, in <module>
  conn= S3Connection(aws_access_key_id,aws_secret_access_key);
File "/Library/Python/2.7/site-packages/boto/s3/connection.py", line 190, in __init__
  validate_certs=validate_certs, profile_name=profile_name)
File "/Library/Python/2.7/site-packages/boto/connection.py", line 572, in __init__
  host, config, self.provider, self._required_auth_capability())
File "/Library/Python/2.7/site-packages/boto/auth.py", line 883, in get_auth_handler
  'Check your credentials' % (len(names), str(names)))
boto.exception.NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV1Handler'] Check your credentials

编辑: Os.environ似乎与getenv相同......

但是我不太确定如何使用它,因为它需要2个参数?

我认为解决方案是让我的bash shell在eclipse pydev中运行。有谁知道怎么做?

0 个答案:

没有答案