Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat's the proper way to install pip, virtualenv, and distribute for Python?
    text
    copied!<h2>Short Question</h2> <ul> <li>What is the proper way to install <a href="http://pip.readthedocs.org" rel="noreferrer"><code>pip</code></a>, <a href="http://virtualenv.openplans.org/" rel="noreferrer"><code>virtualenv</code></a>, and <a href="http://packages.python.org/distribute/" rel="noreferrer"><code>distribute</code></a>?</li> </ul> <h2>Background</h2> <p>In <a href="https://stackoverflow.com/questions/4314376/python-egg-file/4314446#4314446">my answer</a> to <a href="https://stackoverflow.com/questions/4314376/python-egg-file">SO question 4314376</a>, I recommended using <code>ez_setup</code> so that you could then install <code>pip</code> and <code>virtualenv</code> as follows:</p> <pre><code>curl -O http://peak.telecommunity.com/dist/ez_setup.py sudo python ez_setup.py sudo easy_install pip sudo pip install virtualenv </code></pre> <p>I originally pulled these instructions from Jesse Noller's blog post <a href="http://jessenoller.com/2009/03/16/so-you-want-to-use-python-on-the-mac/" rel="noreferrer">So you want to use Python on the Mac?</a>. I like the idea of keeping a clean global site-packages directory, so the only other packages I install there are <a href="http://www.doughellmann.com/projects/virtualenvwrapper/" rel="noreferrer"><code>virtualenvwrapper</code></a> and <a href="http://packages.python.org/distribute/" rel="noreferrer"><code>distribute</code></a>. (I recently added <a href="http://packages.python.org/distribute/" rel="noreferrer"><code>distribute</code></a> to my toolbox because of <a href="http://s3.pixane.com/pip_distribute.png" rel="noreferrer">this Python public service announcement</a>. To install these two packages, I used:</p> <pre><code>sudo pip install virtualenvwrapper curl -O http://python-distribute.org/distribute_setup.py sudo python distribute_setup.py </code></pre> <h2>No more setuptools and easy_install</h2> <p>To really follow <a href="http://s3.pixane.com/pip_distribute.png" rel="noreferrer">that Python public service announcement</a>, on a fresh Python install, I would do the following:</p> <pre><code>curl -O http://python-distribute.org/distribute_setup.py sudo python distribute_setup.py sudo easy_install pip sudo pip install virtualenv sudo pip install virtualenvwrapper </code></pre> <h2>Glyph's Rebuke</h2> <p>In a comment to <a href="https://stackoverflow.com/questions/4314376/python-egg-file/4314446#4314446">my answer</a> to <a href="https://stackoverflow.com/questions/4314376/python-egg-file">SO question 4314376</a>, SO user <a href="https://stackoverflow.com/users/13564/glyph">Glyph</a> stated:</p> <blockquote> <p>NO. NEVER EVER do <code>sudo python setup.py install</code> whatever. Write a ~/.pydistutils.cfg that puts your pip installation into ~/.local or something. Especially files named <code>ez_setup.py</code> tend to suck down newer versions of things like setuptools and easy_install, which can potentially break other things on your operating system.</p> </blockquote> <h2>Back to the short question</h2> <p>So <a href="https://stackoverflow.com/questions/4314376/python-egg-file/4314446#4314446">Glyph's response</a> leads me to my original question:</p> <ul> <li>What is the proper way to install <a href="http://pip.readthedocs.org" rel="noreferrer"><code>pip</code></a>, <a href="http://virtualenv.openplans.org/" rel="noreferrer"><code>virtualenv</code></a>, and <a href="http://packages.python.org/distribute/" rel="noreferrer"><code>distribute</code></a>?</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload