title: Ansible failed to complete because of deprecated Python even though Python 3 is installed
body: <p>I'm trying to run LaunchKit from google to get some app screenshots. I've gone through all of the steps on the GitHub page (<a href="https://github.com/LaunchKit/LaunchKit" rel="nofollow noreferrer">https://github.com/LaunchKit/LaunchKit</a>) for the open source code. After going through all the steps and running <code>$ vagrant up --provision</code> I get the following: </p>
  
  <pre><code>Bringing machine 'default' up with 'virtualbox' provider...
  ==&gt; default: Checking if box 'ubuntu/trusty64' version '20190514.0.0' is up to date...
  ==&gt; default: Running provisioner: ansible...
  Vagrant has automatically selected the compatibility mode '2.0'
  according to the Ansible version installed (2.9.2).
  
  Alternatively, the compatibility mode can be specified in your Vagrantfile:
  https://www.vagrantup.com/docs/provisioning/ansible_common.html#compatibility_mode
  
      default: Running ansible-playbook...
  
  PLAY [all] *********************************************************************
  
  TASK [Gathering Facts] *********************************************************
  ok: [default]
  
  TASK [update apt cache] ********************************************************
  ok: [default]
  
  TASK [common : install the unzip tool] *****************************************
  ok: [default]
  
  TASK [common : install launchkit dummy service] ********************************
  ok: [default]
  
  TASK [common : install vagrant start bug workaround] ***************************
  ok: [default]
  
  TASK [common-python : install python dev library] ******************************
  ok: [default]
  
  TASK [common-python : install packages for pip crypto] *************************
  ok: [default]
  
  TASK [common-python : install packages for ssl] ********************************
  ok: [default]
  
  TASK [common-python : install pip] *********************************************
  ok: [default]
  
  TASK [common-python : install python virtualenv] *******************************
  ok: [default]
  
  TASK [redis : install redis] ***************************************************
  ok: [default]
  
  TASK [redis : install redis config] ********************************************
  ok: [default]
  
  TASK [postgres : install postgres] *********************************************
  ok: [default]
  
  TASK [postgres : install postgres contrib] *************************************
  ok: [default]
  
  TASK [postgres : install postgres dev libraries] *******************************
  ok: [default]
  
  TASK [postgres : install postgres python library for further ansible configuration] ***
  ok: [default]
  
  TASK [postgres : install postgres config] **************************************
  ok: [default]
  
  TASK [postgres : install postgres security config] *****************************
  ok: [default]
  
  TASK [postgres : install postgres upstart service translation] *****************
  ok: [default]
  
  TASK [postgres : add local user as postgres superuser] *************************
  ok: [default]
  
  TASK [lk-django : install python lxml library] *********************************
  ok: [default]
  
  TASK [lk-django : install jpeg library for pillow] *****************************
  ok: [default]
  
  TASK [lk-django : install jpeg-dev library for pillow] *************************
  ok: [default]
  
  TASK [lk-django : install db adapter] ******************************************
  ok: [default]
  
  TASK [lk-django : upgrade pip] *************************************************
  ok: [default]
  
  TASK [lk-django : install python requirements] *********************************
  fatal: [default]: FAILED! =&gt; {"changed": false, "cmd": ["/usr/local/bin/pip2", "install", "-r", "/vagrant/requirements.txt"], 
  "msg": "stdout: Requirement already satisfied: boto==2.38.0 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 1)) (2.38.0)\nRequirement already satisfied:
   celery[redis]==3.1.17 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 2)) (3.1.17)\nRequirement already satisfied: cssutils==1.0.1
   in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 3)) (1.0.1)\nRequirement already satisfied: django-bitfield==1.7.1 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 4)) (1.7.1)\nRequirement already satisfied:
   Django==1.7.3 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 5)) (1.7.3)\nRequirement already satisfied: djorm-pgarray==1.2.0 in 
  /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 6)) (1.2)\nRequirement already satisfied: dnspython==1.12.0 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 7)) (1.12.0)\nRequirement already satisfied:
   fabric==1.10.1 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 8)) (1.10.1)\nRequirement already satisfied: hiredis==0.1.5 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 9)) (0.1.5)\nRequirement already satisfied: Pillow==3.0.0 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 10)) (3.0.0)\nRequirement already satisfied: premailer==1.3.0 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 11)) (1.3.0)\nRequirement already satisfied: psycopg2==2.5.4 in 
  /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 12)) (2.5.4)\nRequirement already satisfied: pycrypto==2.6.1 in /usr/lib/python2.7/dist-packages 
  (from -r /vagrant/requirements.txt (line 13)) (2.6.1)\nRequirement already satisfied: pylint==0.28.0 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 14)) (0.28.0)\nRequirement already satisfied: python-memcached==1.53 in 
  /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 15)) (1.53)\nRequirement already satisfied: redis==2.10.3 in /usr/local/lib/python2.7/dist-packages (from -r /vagrant/requirements.txt (line 16)) (2.10.3)\nCollecting requests==2.5.3\n  Using cached https://files.pythonhosted.org/packages/95/54/44dc83b5f11c6da06bf9abd18c8a0905e0e297e0a9c3bfbc0c6ee4bdd33d/requests-2.5.3-py2.py3-none-any.whl\nProcessing 
  /root/.cache/pip/wheels/59/10/55/80c2bd162c923de93fbec8237cdceeb795507da2748926850e/SQLAlchemy-0.9.8-cp27-none-linux_x86_64.whl\nCollecting tweepy==3.3.0\n  Using cached https://files.pythonhosted.org/packages/cd/8b/dfeeb1057d37af810161f8206aa5a6e6e9351dd87ea6f84e4f87d7e3c8a3/tweepy-3.3.0-py2.py3-none-any.whl\nProcessing 
  /root/.cache/pip/wheels/1f/ea/0a/599a5398012b4e42f32cdfa9101fe35697d3df97282e1da5f3/ua_parser-0.3.6-cp27-none-any.whl\nRequirement already satisfied: billiard&lt;3.4,&gt;=3.3.0.19 in /usr/local/lib/python2.7/dist-packages (from celery[redis]==3.1.17-&gt;-r /vagrant/requirements.txt
   (line 2)) (3.3.0.23)\nRequirement already satisfied: pytz&gt;dev in /usr/local/lib/python2.7/dist-packages (from celery[redis]==3.1.17-&gt;-r /vagrant/requirements.txt (line 2)) (2019.3)\nRequirement already satisfied: kombu&lt;3.1,&gt;=3.0.24 in /usr/local/lib/python2.7/dist-packages (from celery[redis]==3.1.17-&gt;-r /vagrant/requirements.txt (line 2)) 
  (3.0.37)\nRequirement already satisfied: six in /usr/lib/python2.7/dist-packages (from django-bitfield==1.7.1-&gt;-r /vagrant/requirements.txt (line 4)) (1.5.2)\nRequirement already satisfied: paramiko&gt;=1.10 in /usr/local/lib/python2.7/dist-packages (from fabric==1.10.1-&gt;-r 
  /vagrant/requirements.txt (line 8)) (2.7.1)\nRequirement already satisfied: cssselect in /usr/local/lib/python2.7/dist-packages (from premailer==1.3.0-&gt;-r /vagrant/requirements.txt (line 11)) (1.1.0)\nRequirement already satisfied: lxml in /usr/lib/python2.7/dist-packages (from premailer==1.3.0-&gt;-r /vagrant/requirements.txt (line 11)) (3.3.3)\nRequirement already satisfied
  : logilab-common&gt;=0.53.0 in /usr/local/lib/python2.7/dist-packages (from pylint==0.28.0-&gt;-r /vagrant/requirements.txt (line 14)) (1.4.4)\nRequirement already satisfied: logilab-astng&gt;=0.24.3 in /usr/local/lib/python2.7/dist-packages (from pylint==0.28.0-&gt;-r 
  /vagrant/requirements.txt (line 14)) (0.24.3)\nCollecting requests-oauthlib&gt;=0.4.1\n  Using cached 
  https://files.pythonhosted.org/packages/a3/12/b92740d845ab62ea4edf04d2f4164d82532b5a0b03836d4d4e71c6f3d379/requests_oauthlib-1.3.0-py2.py3-none-any.whl\nRequirement already satisfied: anyjson&gt;=0.3.3 in /usr/local/lib/python2.7/dist-packages (from kombu&lt;3.1,&gt;=3.0.24-&gt;celery[redis]==3.1.17-&gt;-r /vagrant/requirements.txt (line 2)) (0.3.3)\nRequirement already satisfied: amqp&lt;2.0,&gt;=1.4.9 in /usr/local/lib/python2.7/dist-packages (from kombu&lt;3.1,&gt;=3.0.24-&gt;celery[redis]==3.1.17-&gt;-r /vagrant/requirements.txt (line 2)) (1.4.9)\nRequirement already satisfied: bcrypt&gt;=3.1.3 in /usr/local/lib/python2.7/dist-packages (from paramiko&gt;=1.10-&gt;fabric==1.10.1-&gt;-r /vagrant/requirements.txt (line 8)) (3.1.7)\nRequirement already satisfied: cryptography&gt;=2.5 in /usr/local/lib/python2.7/dist-packages (from paramiko&gt;=1.10-&gt;fabric==1.10.1-&gt;-r /vagrant/requirements.txt (line 8)) (2.8)\nRequirement already satisfied: pynacl&gt;=1.0.1 in /usr/local/lib/python2.7/dist-packages (from paramiko&gt;=1.10-&gt;fabric==1.10.1-&gt;-r /vagrant/requirements.txt (line 8)) (1.3.0)\nRequirement already satisfied: setuptools in /usr/lib/python2.7/dist-packages (from logilab-common&gt;=0.53.0-&gt;pylint==0.28.0-&gt;-r /vagrant/requirements.txt (line 14)) (3.3)\nCollecting oauthlib&gt;=3.0.0\n  Using cached https://files.pythonhosted.org/packages/05/57/ce2e7a8fa7c0afb54a0581b14a65b56e62b5759dbc98e80627142b8a3704/oauthlib-3.1.0-py2.py3-none-any.whl\nRequirement already satisfied: cffi&gt;=1.1 in /usr/local/lib/python2.7/dist-packages (from bcrypt&gt;=3.1.3-&gt;paramiko&gt;=1.10-&gt;fabric==1.10.1-&gt;-r /vagrant/requirements.txt (line 8)) (1.13.2)\nRequirement already satisfied: enum34; python_version &lt; \"3\" in /usr/local/lib/python2.7/dist-packages (from cryptography&gt;=2.5-&gt;paramiko&gt;=1.10-&gt;fabric==1.10.1-&gt;-r /vagrant/requirements.txt (line 8)) (1.1.6)\nRequirement already satisfied: ipaddress; python_version &lt; \"3\" in /usr/local/lib/python2.7/dist-packages (from cryptography&gt;=2.5-&gt;paramiko&gt;=1.10-&gt;fabric==1.10.1-&gt;-r /vagrant/requirements.txt (line 8)) (1.0.23)\nRequirement already satisfied: pycparser in /usr/local/lib/python2.7/dist-packages (from cffi&gt;=1.1-&gt;bcrypt&gt;=3.1.3-&gt;paramiko&gt;=1.10-&gt;fabric==1.10.1-&gt;-r /vagrant/requirements.txt (line 8)) (2.19)\nInstalling collected packages: requests, sqlalchemy, oauthlib, requests-oauthlib, tweepy, ua-parser\n  
  Found existing installation: requests 2.2.1\n\n:stderr: /usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning:
   Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a release (2.7.7+) that supports hmac.compare_digest as soon as possible.\n  utils.PersistentlyDeprecated2018,\nDEPRECATION: 
  Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for
   Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support\n/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/util/ssl_.py:380: 
  SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS
   certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-
  usage.html#ssl-warnings\n  SNIMissingWarning,\n/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/util/ssl_.py:139: InsecurePlatformWarning: A true SSLContext object
   is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more
   information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\n  InsecurePlatformWarning,\nERROR: tweepy 3.3.0 has requirement six&gt;=1.7.3, but you'll have six
   1.5.2 which is incompatible.\nERROR: Cannot uninstall 'requests'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only
   a partial uninstall.\n"}
  
  PLAY RECAP *********************************************************************
  default                    : ok=25   changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
  
  Ansible failed to complete successfully. Any error output should be
  visible above. Please fix these errors and try again.
  </code></pre>
  
  <p>The current version of Python2 is 2.7.10 (above the 2.7.7+ it requests) and I've also installed python 3 (3.7.6).</p>
  
  <p>This is my first time working this in-depth in Terminal.</p>
  
  <p>I've also tried creating an alias for python = python3, but it still seems to be running Python2 when vagrant up --provision is called.</p>
  
  <p>Any ideas on how to fix this?</p>