title: Upgrading pip before installing requirements on AWS Beanstalk
body: <p>I'm using a library (<code>weasyprint</code>) that requires a newer version of pip than what is provided by the AWS Beanstalk platform. I have an <code>.ebextensions</code> file that upgrades pip like so:</p>
  
  <pre><code>commands:
    01_upgrade_pip:
      command: '/opt/python/run/venv/bin/pip install --upgrade pip'
      ignoreErrors: false
  </code></pre>
  
  <p>Thing is, every time the instance is rebuilt, the <code>weasyprint</code> install fails, but if I try to deploy again on the same instance, it successfully deploys. My guess is that pip isn't getting upgraded before <code>weasyprint</code> gets installed, and then the second time around pip is upgraded so it works. Is there a way to ensure pip gets upgraded as soon as the instance is created?</p>
  
  <p>I'm using <code>Python 3.6 running on 64bit Amazon Linux/2.9.7</code></p>