title: install python package at current directory
body: <p>I am mac user, used to run pip install with <code>--user</code>, but recently after <code>brew update</code>, I found there are some strange things, maybe related.</p>
  <p>Whatever I tries, the packages are always installed to <code>~/Library/Python/2.7/lib/python/site-packages</code></p>
  <p>Here are the commands I run.</p>
  <pre><code>$ python -m site --user-site
  ~/Library/Python/2.7/lib/python/site-packages
  
  $ pip install --user -r requirements.txt
  
  $ PYTHONUSERBASE=. pip install --user -r requirements.txt
  </code></pre>
  <p>So what should be the problem?</p>
  <p>I used for lambda zip packaging</p>
  <h3>Updates:</h3>
  <p>If using Mac OS X and you have Python installed using Homebrew (see Homebrew), the accepted command will not work. A simple workaround is to add a <code>setup.cfg</code> file in your <code>/path/to/project-dir</code> with the following content.</p>
  <pre><code>[install]
  prefix=
  </code></pre>
  <p><a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html</a></p>