title: AWS linux : ansible 2.9.7 using ec2.py and python 3.7 getting : ImportError: No module named boto , boto do installed
body: <p>i installed python 3.7   </p>
  
  <pre><code> python --version
  Python 3.7.6
  </code></pre>
  
  <p>i have python 2.7 installed also but i dont want to use it<br>
  so i set :<br>
  set alias python=python3    </p>
  
  <p>ansible :  </p>
  
  <pre><code>ansible --version
  ansible 2.9.7
    config file = /etc/ansible/ansible.cfg
    configured module search path = ['/home/ec2-user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
    ansible python module location = /home/ec2-user/.local/lib/python3.7/site-packages/ansible
    executable location = /home/ec2-user/.local/bin/ansible
    python version = 3.7.6 (default, Feb 26 2020, 20:54:15) [GCC 7.3.1 20180712 (Red Hat 7.3.1-6)]
  </code></pre>
  
  <p>in /etc/ansible/hosts i set the ec2.py from here :<br>
  <a href="https://raw.githubusercontent.com/ansible/ansible/stable-2.9/contrib/inventory/ec2.py" rel="nofollow noreferrer">https://raw.githubusercontent.com/ansible/ansible/stable-2.9/contrib/inventory/ec2.py</a><br>
  but when i run :  </p>
  
  <pre><code>ansible localhost -m ping 
  </code></pre>
  
  <p>I'm getting :</p>
  
  <pre><code>[WARNING]:  * Failed to parse /etc/ansible/hosts with script plugin: Inventory script (/etc/ansible/hosts) had an execution error: Traceback (most recent call last):   File "/etc/ansible/hosts", line 164, in &lt;module&gt;     import boto
  ImportError: No module named boto
  [WARNING]:  * Failed to parse /etc/ansible/hosts with yaml plugin: Syntax Error while loading YAML.   expected '&lt;document start&gt;', but found '&lt;scalar&gt;'  The error appears to be in '/etc/ansible/hosts': line 12, column 31, but may be
  elsewhere in the file depending on the exact syntax problem.  The offending line appears to be:  variables needed for Boto have already been set:     export AWS_ACCESS_KEY_ID='AK123'                               ^ here
  [WARNING]:  * Failed to parse /etc/ansible/hosts with ini plugin: /etc/ansible/hosts:3: Error parsing host definition ''''': No closing quotation
  [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
  [WARNING]: No inventory was parsed, only implicit localhost is available
  
  PLAY [Ansible Ad-Hoc] ***********************************************************************************************************************************************************************************************************************
  
  TASK [ping] *********************************************************************************************************************************************************************************************************************************
  Saturday 02 May 2020  08:36:13 +0000 (0:00:00.089)       0:00:00.089 **********
  ok: [localhost]
  
  PLAY RECAP **********************************************************************************************************************************************************************************************************************************
  localhost                  : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
  
  Saturday 02 May 2020  08:36:14 +0000 (0:00:00.290)       0:00:00.380 **********
  ===============================================================================
  
  boto and boto3 are installed in my server 
  
      pip3 install boto
      Defaulting to user installation because normal site-packages is not writeable
      Requirement already satisfied: boto in ./.local/lib/python3.7/site-packages (2.49.0)
  
  
  </code></pre>
  
  <pre><code>pip3 install boto3
  Defaulting to user installation because normal site-packages is not writeable
  Requirement already satisfied: boto3 in ./.local/lib/python3.7/site-packages (1.13.0)
  Requirement already satisfied: s3transfer&lt;0.4.0,&gt;=0.3.0 in ./.local/lib/python3.7/site-packages (from boto3) (0.3.3)
  Requirement already satisfied: botocore&lt;1.17.0,&gt;=1.16.0 in ./.local/lib/python3.7/site-packages (from boto3) (1.16.0)
  Requirement already satisfied: jmespath&lt;1.0.0,&gt;=0.7.1 in ./.local/lib/python3.7/site-packages (from boto3) (0.9.5)
  Requirement already satisfied: docutils&lt;0.16,&gt;=0.10 in ./.local/lib/python3.7/site-packages (from botocore&lt;1.17.0,&gt;=1.16.0-&gt;boto3) (0.15.2)
  Requirement already satisfied: urllib3&lt;1.26,&gt;=1.20; python_version != "3.4" in ./.local/lib/python3.7/site-packages (from botocore&lt;1.17.0,&gt;=1.16.0-&gt;boto3) (1.25.9)
  Requirement already satisfied: python-dateutil&lt;3.0.0,&gt;=2.1 in ./.local/lib/python3.7/site-packages (from botocore&lt;1.17.0,&gt;=1.16.0-&gt;boto3) (2.8.1)
  Requirement already satisfied: six&gt;=1.5 in ./.local/lib/python3.7/site-packages (from python-dateutil&lt;3.0.0,&gt;=2.1-&gt;botocore&lt;1.17.0,&gt;=1.16.0-&gt;boto3) (1.14.0)
  </code></pre>