简体   繁体   中英

Make a program (aws cli) accessible for all users, installed by pip

i installed aws-cli using sudo pip install awscli when i run awscli as current user it works but when i run try to run awscli as other user i get

sudo -u jenkins aws
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 17, in <module>
    import botocore.session
  File "/usr/local/lib/python2.7/dist-packages/botocore/session.py", line 28, in <module>
    import botocore.client
  File "/usr/local/lib/python2.7/dist-packages/botocore/client.py", line 16, in <module>
    from botocore import waiter, xform_name
  File "/usr/local/lib/python2.7/dist-packages/botocore/waiter.py", line 13, in <module>
    import jmespath
ImportError: No module named jmespath

Same issue occured while I was using normal user.

# sudo -i    # switch to root
# aws configure          # give credencials

Then switch back to normal user. aws configure would be working for normal user and root user.

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