What should be my python packages path?
<p>I'm on Mac OS X and I've heard that to avoid global installation of packages (using sudo) that might cause problems with the python files that OS X uses, the path to install python packages must be different than that of OS X. </p>

<p>Currently python executables are installed in : </p>

<pre><code>/usr/local/bin/
</code></pre>

<p>Pip installs modules over here : </p>

<pre><code>/usr/local/lib/python2.7/site-packages
</code></pre>

<p>Python is used from here : </p>

<pre><code>/usr/local/bin/python
</code></pre>

<p>Are these paths safe?</p>

<p>I suggest you to make use of virtual environments, you can learn more about them here: <a href="http://docs.python-guide.org/en/latest/dev/virtualenvs/" rel="nofollow">http://docs.python-guide.org/en/latest/dev/virtualenvs/</a></p>

<p>to sum up </p>

<ol>
<li>Create a virtual environment (venv): <code>$ virtualenv venv</code></li>
</ol>

<blockquote>
  <p>This creates a copy of Python in whichever directory you ran the command in placing it in a folder named venv.</p>
</blockquote>

<ol start="2">
<li>Activate the virtual environment: <code>$ source venv/bin/activate</code></li>
<li>Install packages with pip: <code>$ pip install requests</code></li>
<li>When you are done deactivate the virtual environment: <code>$ deactivate</code></li>
</ol>

python osx pip