title: How to specify python version on self-hosted (Linux Ubuntu 18.04) agent while running a pipeline through MS DevOps
body: <p>I am trying to run a simple bash script using a yaml pipeline through MS DevOps. I want to be using Python version 3.8. When connecting to the self-hosted agent via SSH, I am able to run the script specified in the yaml file without any problems. However, when I run the script through the pipeline, it fails because for some reason the <code>python</code> alias is referring to Python 2.7.17.</p>
  <p>I tried setting the following alias in both the <code>.bashrc</code> for the <code>agentsvc</code> user as well as in the <code>bash.bashrc</code> file: <code>alias python='python3.8'</code>.</p>
  <p>I realize I can change <code>python</code> to <code>python3.8</code> in my script however I do not want to do this. Does anybody have any ideas why the alias is not working in the pipeline environment and what I can do to fix this?</p>
  <p>Here is a sample of the yaml pipeline that I am trying to run:</p>
  <pre><code>pool: myubuntuagent
  
  trigger:
    - master
  
  steps:
    - script: |
        # install pre-requisites
        whoami
        python -V
        python -m pip install -r requirements.txt
      workingDirectory: '$(System.DefaultWorkingDirectory)'
      displayName: 'Install Prerequisites etc. etc. etc.'
  </code></pre>