title: aws-sam-cli Python requirements.txt missing from deployed Lambda when custom template.yaml
body: <p>I have several AWS SAM templates for the same project, where the lambdas use Python 3.8, partly for different environments, and partly to try out new things, and I use <code>-t my-template.yaml</code> to specify which template to use.</p>
  <p>I build using the regular <code>sam build -t my-template.yaml &amp;&amp; sam deploy -t my-template.yaml</code>.</p>
  <p>Problem: the requirements.txt file seems to be respected in the build step appears to be ignored by the deploy step.</p>
  <p><code>.aws-sam/build/MyFunction</code> contains the requirements:</p>
  <pre><code>$ ls
  app.py   
  certifi-2020.12.5.dist-info  
  chardet-4.0.0.dist-info  
  idna-2.10.dist-info  
  pymysql                  
  rds_config.py  
  requests-2.25.1.dist-info  
  urllib3
  certifi  
  chardet                      
  idna                     
  __init__.py          
  PyMySQL-1.0.2.dist-info  
  requests       
  requirements.txt           
  urllib3-1.26.3.dist-info
  </code></pre>
  <p>But when running in the cloud, the lambda fails with an exception saying that pymysql is not found, and when I check the function in the AWS UI, there are no requirements included (eg. no PyMySQL-1.0.2.dist-info).</p>
  <p>I noticed that if I don't use the <code>-t</code> flag on <code>sam deploy</code> and just have the default <code>template.yaml</code> file there, then the requirements appear to be included correctly, and the lambda runs successfully.</p>
  <p>What may I be doing wrong?</p>
  <p>requirements.txt contents:</p>
  <pre><code>$ cat requirements.txt
  requests
  pymysql
  </code></pre>
  <p>SAM version:</p>
  <pre><code>$ sam --version
  SAM CLI, version 1.18.1
  </code></pre>
  <p>OS:</p>
  <pre><code>$ cat /etc/os-release 
  NAME=&quot;Ubuntu&quot;
  VERSION=&quot;20.04.2 LTS (Focal Fossa)&quot;
  ....
  </code></pre>