Skip to content

Commit 160731b

Browse files
author
Kenneth Reitz
committed
osx updates
1 parent 365ab6b commit 160731b

2 files changed

Lines changed: 17 additions & 102 deletions

File tree

docs/starting/install/osx.rst

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Mac OS X
2-
========
1+
Installing Python on Mac OS X
2+
=============================
33

44
*Or, "Installing Python 2.7 via Homebrew".*
55

@@ -31,45 +31,35 @@ bugs.
3131

3232
*Don't forget to update your environment PATH.*
3333

34-
Building From Source
35-
--------------------
36-
37-
.. todo:: Write "Building From Source"
38-
3934

4035
Distribute & Pip
4136
----------------
4237

43-
*Distribute* is a fantastic drop-in replacement for *easy_install* and
44-
*setuptools*. It allows you to install and manage python packages from
45-
pypi.python.org, amongst a few other sources. It also plays well with
46-
*virtualenv* and user-enviornments.
38+
The most crucial third-party Python software of all is Distribute, which extends the packaging and installation facilities provided by the distutils in the standard library. Once you add Distribute to your Python system you can download and install any compliant Python software product with a single command. It also enables you to add this network installation capability to your own Python software with very little work.
4739

48-
**easy_install** is considered by many to be a deprecated system, so we
49-
will install it's replacement: **pip**. Pip allows for uninstallation
50-
of packages, and is actively maintained, unlike setuptool's easy_install.
40+
Hombrew already installed Distribute for you. Its ``easy_install`` command is considered by many to be deprecated, so we will install its replacement: **pip**. Pip allows for uninstallation of packages, and is actively maintained, unlike easy_install.
5141

52-
To install *pip* and Distribute's *easy_install*:
42+
To install pip, simply open a command prompt and run::
5343

54-
If you have homebrew: ::
44+
$ easy_install pip
5545

56-
$ brew install pip
5746

58-
...And, if you're a masochist: ::
5947

60-
$ curl -O http://python-distribute.org/distribute_setup.py
61-
$ python distribute_setup.py
6248

63-
$ easy_install pip
49+
Virtualenv
50+
----------
6451

65-
Hopefully you'll never have to use **easy_install** again.
52+
After Distribute & Pip, the next development tool that you should install is `virtualenv <http://pypi.python.org/pypi/virtualenv/>`_. Use pip::
6653

54+
$ pip install virtualenv
6755

68-
Updating Python
69-
---------------
56+
The virtualenv kit provides the ability to create virtual Python environments that do not interfere with either each other, or the main Python installation. If you install virtualenv before you begin coding then you can get into the habit of using it to create completely clean Python environments for each project. This is particularly important for Web development, where each framework and application will have many dependencies.
57+
58+
To set up a new Python environment, change the working directory to where ever you want to store the environment, and run the virtualenv utility in your project's directory::
59+
60+
$ virtualenv --distribute venv
7061

71-
Homebrew makes it simple. ::
62+
To use an environment, run `source venv/bin/activate``. Your command prompt will change to show the active environment. Once you have finished working in the current virtual environment, run ``deactivate`` to restore your settings to normal.
7263

73-
$ brew update
74-
$ brew install --force python
64+
Each new environment automatically includes a copy of ``pip``, so that you can setup the third-party libraries and tools that you want to use in that environment. Put your own code within a subdirectory of the environment, however you wish. When you no longer need a particular environment, simply copy your code out of it, and then delete the main directory for the environment.
7565

docs/starting/installation.rst

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,6 @@
11
Properly Installing Python
22
==========================
33

4-
Mac OS X
5-
::::::::
6-
7-
*Or, "Installing Python 2.7 via Homebrew".*
8-
9-
Package Manager
10-
---------------
11-
12-
While Snow Leopard comes with a large number of UNIX utilities, those
13-
familiar with Linux systems will notice one key component missing: a
14-
package manager. Mxcl's `Homebrew <http://mxcl.github.com/homebrew/>`_ is the answer.
15-
16-
To `install Homebrew <https://github.com/mxcl/homebrew/wiki/installation>`_, simply run: ::
17-
18-
$ ruby -e "$(curl -fsS https://raw.github.com/gist/323731)"
19-
20-
21-
It's basic commands are **update**, **install**, and **remove**.
22-
23-
.. man brew
24-
25-
26-
And we can now install Python 2.7: ::
27-
28-
$ brew install python --framework
29-
30-
31-
The ``--framework`` 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
32-
is built as a Framework, so this helps avoid some future module installation
33-
bugs.
34-
35-
*Don't forget to update your environment PATH.*
36-
37-
Building From Source
38-
--------------------
39-
40-
.. todo:: Write "Building From Source"
41-
42-
43-
Distribute & Pip
44-
----------------
45-
46-
*Distribute* is a fantastic drop-in replacement for *easy_install* and
47-
*setuptools*. It allows you to install and manage python packages from
48-
pypi.python.org, amongst a few other sources. It also plays well with
49-
*virtualenv* and user-enviornments.
50-
51-
**easy_install** is considered by many to be a deprecated system, so we
52-
will install it's replacement: **pip**. Pip allows for uninstallation
53-
of packages, and is actively maintained, unlike setuptool's easy_install.
54-
55-
To install *pip* and Distribute's *easy_install*:
56-
57-
If you have homebrew: ::
58-
59-
$ brew install pip
60-
61-
...And, if you're a masochist: ::
62-
63-
$ curl -O http://python-distribute.org/distribute_setup.py
64-
$ python distribute_setup.py
65-
66-
$ easy_install pip
67-
68-
Hopefully you'll never have to use **easy_install** again.
69-
70-
71-
Updating Python
72-
---------------
73-
74-
Homebrew makes it simple. ::
75-
76-
$ brew update
77-
$ brew install --force python
78-
794

805
Windows
816
:::::::

0 commit comments

Comments
 (0)