简体   繁体   中英

aws cli error when running as a normal user but not root

I've been testing a sandbox server with aws cli. I installed pip, boto, and awscli as root, and can run aws s3 ls quite successfully as root, but when I try to run the same command as myself (not root), I get a clidriver error as follows:

$ aws s3 ls
Traceback (most recent call last):
  File "/usr/local/bin/aws", line 19, in <module>
    import awscli.clidriver

ImportError: No module named awscli.clidriver

Anybody have an idea as to what permissions are missing, considering this works as root?

No, both users (myself and root) were using the same python. The problem turned out to be ansible playbook which put the awscli on the system. The site-package had permissions for only root to operate them. I edited the playbook and added a umask setting to pip tasks it was using. It took quite a bit of experimenting to get it all working as ansible doesn't seem to change the permissions if the file itself hasn't changed. So, I ended up doing a pip uninstall on several packages and rerunning the playbook several times. Eventually, after determining that the umask value had to contained in quotations (unlike even the ansible webpage example), everything worked. Thanks for the thought however.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM