<p>Managed to get rid of error by </p>

<pre><code>pip install awscli --force-reinstall --upgrade
</code></pre>

<p>then from rundeck interface:</p>

<pre><code>aws configure set aws_access_key_id default_access_key
aws configure set aws_secret_access_key default_secret_key
aws configure set default.region us-west-2
</code></pre>

CC BY-SA 3.0
2018-03-13T08:17:34.317Z
2018-03-13T16:49:31.343Z
2018-03-13T16:49:31.343Z
Milister
<p>From terminal all works fine, botocore is installed</p>

<pre><code>Traceback (most recent call last):
      File "/bin/aws", line 19, in &lt;module&gt;
        import awscli.clidriver
      File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 17, in &lt;module&gt;
        import botocore.session
    ImportError: No module named botocore.session

 pip install botocore
Requirement already satisfied: botocore in /root/.local/lib/python2.7/site-packages
Requirement already satisfied: jmespath&lt;1.0.0,&gt;=0.7.1 in /root/.local/lib/python2.7/site-packages (from botocore)
Requirement already satisfied: docutils&gt;=0.10 in /root/.local/lib/python2.7/site-packages (from botocore)
Requirement already satisfied: python-dateutil&lt;3.0.0,&gt;=2.1 in /usr/lib/python2.7/site-packages (from botocore)
Requirement already satisfied: six&gt;=1.5 in /root/.local/lib/python2.7/site-packages (from python-dateutil&lt;3.0.0,&gt;=2.1-&gt;botocore)
</code></pre>

<p>env:</p>

<pre><code>SUDO_USER=ja
SUDO_UID=1000
USERNAME=root
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAIL=/var/spool/mail/ja
PWD=/tmp
LANG=en_US.UTF-8
SHLVL=1
SUDO_COMMAND=/bin/su
HOME=/root
LOGNAME=root
LESSOPEN=||/usr/bin/lesspipe.sh %s
SUDO_GID=1000
_=/bin/env
</code></pre>

CC BY-SA 3.0
2018-03-12T14:12:25.503Z
Does aws cli works from command line ?
Tensibai
CC BY-SA 3.0
2018-03-12T14:57:00.180Z
Which user from console? Which user running rundeck (I guess root for rundeck...)
Tensibai
CC BY-SA 3.0
2018-03-12T15:08:41.677Z
Do you confirm rundeck is running as root also ?
Tensibai
CC BY-SA 3.0
2018-03-12T15:09:37.770Z
yes, it is, checked
Milister
CC BY-SA 3.0
2018-03-12T16:28:26.923Z
May you share a `env && aws --version` in cli and rundeck ? (take care to redact any access key or private information in env)
Tensibai
<python><rundeck>
Unable to run AWS CLI commands from Rundeck-No module named botocore.session
Milister
# Unable to run AWS CLI commands from Rundeck-No module named botocore.session

(Asked by: username_0 on 2018-03-12)

From terminal all works fine, botocore is installed
Traceback (most recent call last):
      File "/bin/aws", line 19, in 
        import awscli.clidriver
      File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 17, in 
        import botocore.session
    ImportError: No module named botocore.session

 pip install botocore
Requirement already satisfied: botocore in /root/.local/lib/python2.7/site-packages
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /root/.local/lib/python2.7/site-packages (from botocore)
Requirement already satisfied: docutils>=0.10 in /root/.local/lib/python2.7/site-packages (from botocore)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/lib/python2.7/site-packages (from botocore)
Requirement already satisfied: six>=1.5 in /root/.local/lib/python2.7/site-packages (from python-dateutil<3.0.0,>=2.1->botocore)

env:
SUDO_USER=ja
SUDO_UID=1000
USERNAME=root
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAIL=/var/spool/mail/ja
PWD=/tmp
LANG=en_US.UTF-8
SHLVL=1
SUDO_COMMAND=/bin/su
HOME=/root
LOGNAME=root
LESSOPEN=||/usr/bin/lesspipe.sh %s
SUDO_GID=1000
_=/bin/env

**Tags:** python, rundeck

> **Comments:**
> **username_1**: Does aws cli works from command line ?  
> **username_1**: Which user from console? Which user running rundeck (I guess root for rundeck...)  
> **username_1**: Do you confirm rundeck is running as root also ?  
> **username_0**: yes, it is, checked  
> **username_1**: May you share a `env && aws --version` in cli and rundeck ? (take care to redact any access key or private information in env)  

---

## 1 answers

### Answer by username_0 on 2018-03-13. Score: 1

Managed to get rid of error by 
pip install awscli --force-reinstall --upgrade

then from rundeck interface:
aws configure set aws_access_key_id default_access_key
aws configure set aws_secret_access_key default_secret_key
aws configure set default.region us-west-2


---

