mirror of
https://github.com/kennethreitz/clint.git
synced 2026-06-05 14:50:17 +00:00
157 lines
7.0 KiB
HTML
157 lines
7.0 KiB
HTML
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title>Properly Installing Python — osxpython v0.0.1 documentation</title>
|
|
<link rel="stylesheet" href="_static/flasky.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT: '',
|
|
VERSION: '0.0.1',
|
|
COLLAPSE_INDEX: false,
|
|
FILE_SUFFIX: '.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="_static/jquery.js"></script>
|
|
<script type="text/javascript" src="_static/underscore.js"></script>
|
|
<script type="text/javascript" src="_static/doctools.js"></script>
|
|
<link rel="top" title="osxpython v0.0.1 documentation" href="index.html" />
|
|
<link rel="next" title="Useful Tools" href="useful-tools.html" />
|
|
<link rel="prev" title="Welcome to OSXPython.org" href="index.html" />
|
|
|
|
|
|
<link media="only screen and (max-device-width: 480px)" href="_static/small_flask.css" type= "text/css" rel="stylesheet" />
|
|
|
|
</head>
|
|
<body>
|
|
<div class="related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="genindex.html" title="General Index"
|
|
accesskey="I">index</a></li>
|
|
<li class="right" >
|
|
<a href="useful-tools.html" title="Useful Tools"
|
|
accesskey="N">next</a> |</li>
|
|
<li class="right" >
|
|
<a href="index.html" title="Welcome to OSXPython.org"
|
|
accesskey="P">previous</a> |</li>
|
|
<li><a href="index.html">osxpython v0.0.1 documentation</a> »</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body">
|
|
|
|
<div class="section" id="properly-installing-python">
|
|
<h1>Properly Installing Python<a class="headerlink" href="#properly-installing-python" title="Permalink to this headline">¶</a></h1>
|
|
<p><em>Or, “Installing Python 2.7 via Homebrew”.</em></p>
|
|
<p>One of the reasons everybody loves Python is the interactive shell. It
|
|
basically allows you to execute Python commands in real time and
|
|
immediately get results back. Flask itself does not come with an
|
|
interactive shell, because it does not require any specific setup upfront,
|
|
just import your application and start playing around.</p>
|
|
<div class="section" id="package-manager">
|
|
<h2>Package Manager<a class="headerlink" href="#package-manager" title="Permalink to this headline">¶</a></h2>
|
|
<p>While Snow Leopard comes with a large number of UNIX utilities, those
|
|
familiar with Linux systems will notice one key component missing: a
|
|
package manager. Mxcl’s <em>Homebrew</em> is the answer.</p>
|
|
<p>To install Homebrew, simply run:</p>
|
|
<div class="highlight-python"><pre>$ ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"</pre>
|
|
</div>
|
|
<p>It’s basic commands are <strong>update</strong>, <strong>install</strong>, and <strong>remove</strong>.</p>
|
|
</div>
|
|
<div class="section" id="python-interpreter">
|
|
<h2>Python Interpreter<a class="headerlink" href="#python-interpreter" title="Permalink to this headline">¶</a></h2>
|
|
<p>And we can now install Python 2.7:</p>
|
|
<div class="highlight-python"><pre>$ sudo brew install python --framework</pre>
|
|
</div>
|
|
<p>The <tt class="docutils literal"><span class="pre">--framework</span></tt> option tells Homebrew to compile a Framework-style Python build, rather than a UNIX-style build. The outdated version of Python that Snow Leopard comes packaged with
|
|
is built as a Framework, so this helps avoid some future module installation
|
|
bugs.</p>
|
|
<p><em>Don’t forget to update your environment PATH.</em></p>
|
|
<div class="highlight-python"><pre>$ echo 'EXPORT PATH=/usr/local/Cellar/python2.7/bin:$PATH' >> .profile</pre>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="distribute-pip">
|
|
<h2>Distribute & Pip<a class="headerlink" href="#distribute-pip" title="Permalink to this headline">¶</a></h2>
|
|
<p><em>Distribute</em> is a fantastic drop-in replacement for <em>easy_install</em> and
|
|
<em>setuptools</em>. It allows you to install and manage python packages from
|
|
pypi.python.org, amongst a few other sources. It also plays well with
|
|
<em>virtualenv</em> and user-enviornments.</p>
|
|
<p><strong>easy_install</strong> is considered by many to be a deprecated system, so we
|
|
will install it’s replacement: <strong>pip</strong>. Pip allows for uninstallation
|
|
of packages, and is actively maintained, unlike setuptool’s easy_install.</p>
|
|
<p>To install <em>pip</em> and Distribute’s <em>easy_install</em>:</p>
|
|
<p>If you have homebrew:</p>
|
|
<div class="highlight-python"><pre>$ brew install pip</pre>
|
|
</div>
|
|
<p>...And, if you’re a masochist:</p>
|
|
<div class="highlight-python"><pre>$ curl -O http://python-distribute.org/distribute_setup.py
|
|
$ python distribute_setup.py
|
|
|
|
$ easy_install pip</pre>
|
|
</div>
|
|
<p>To install <tt class="docutils literal"><span class="pre">pip</span></tt>:</p>
|
|
<p>Hopefully you’ll never have to use <strong>easy_install</strong> again.</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar">
|
|
<div class="sphinxsidebarwrapper">
|
|
<h3><a href="index.html">Table Of Contents</a></h3>
|
|
<ul>
|
|
<li><a class="reference internal" href="#">Properly Installing Python</a><ul>
|
|
<li><a class="reference internal" href="#package-manager">Package Manager</a></li>
|
|
<li><a class="reference internal" href="#python-interpreter">Python Interpreter</a></li>
|
|
<li><a class="reference internal" href="#distribute-pip">Distribute & Pip</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h3>Related Topics</h3>
|
|
<ul>
|
|
<li><a href="index.html">Documentation overview</a><ul>
|
|
<li>Previous: <a href="index.html" title="previous chapter">Welcome to OSXPython.org</a></li>
|
|
<li>Next: <a href="useful-tools.html" title="next chapter">Useful Tools</a></li>
|
|
</ul></li>
|
|
</ul>
|
|
<h3>This Page</h3>
|
|
<ul class="this-page-menu">
|
|
<li><a href="_sources/installation.txt"
|
|
rel="nofollow">Show Source</a></li>
|
|
</ul>
|
|
<div id="searchbox" style="display: none">
|
|
<h3>Quick search</h3>
|
|
<form class="search" action="search.html" method="get">
|
|
<input type="text" name="q" size="18" />
|
|
<input type="submit" value="Go" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
<p class="searchtip" style="font-size: 90%">
|
|
Enter search terms or a module, class or function name.
|
|
</p>
|
|
</div>
|
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="footer">
|
|
© Copyright 2010, Kenneth Reitz.
|
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
|
|
</div>
|
|
</body>
|
|
</html> |