You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/starting/install/linux.rst
+38-10Lines changed: 38 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,29 @@ Installing Python on Linux
5
5
6
6
The latest version of Ubuntu, **comes with Python 2.7 out of the box**.
7
7
8
-
You do not need to install or configure anything else to use Python. Having said that, I would strongly recommend that you install the tools and libraries described in the next section before you start building Python applications for real-world use. In particular, you should always install Distribute, as it makes it much easier for you to use other third-party Python libraries.
8
+
You do not need to install or configure anything else to use Python. Having
9
+
said that, I would strongly recommend that you install the tools and libraries
10
+
described in the next section before you start building Python applications
11
+
for real-world use. In particular, you should always install Distribute, as
12
+
it makes it much easier for you to use other third-party Python libraries.
9
13
10
14
Distribute & Pip
11
15
----------------
12
16
13
-
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.
17
+
The most crucial third-party Python software of all is Distribute, which
18
+
extends the packaging and installation facilities provided by the distutils
19
+
in the standard library. Once you add Distribute to your Python system you can
20
+
download and install any compliant Python software product with a single
21
+
command. It also enables you to add this network installation capability to
22
+
your own Python software with very little work.
14
23
15
-
To obtain the latest version of Distribute for Linux, run the python script available here:
24
+
To obtain the latest version of Distribute for Linux, run the python script
25
+
available here:
16
26
http://python-distribute.org/distribute_setup.py
17
27
18
-
The new``easy_install`` command you have available 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.
28
+
The new``easy_install`` command you have available is considered by many to be
29
+
deprecated, so we will install its replacement: **pip**. Pip allows for
30
+
uninstallation of packages, and is actively maintained, unlike easy_install.
19
31
20
32
To install pip, simply open a command prompt and run::
21
33
@@ -25,22 +37,38 @@ To install pip, simply open a command prompt and run::
25
37
Virtualenv
26
38
----------
27
39
28
-
After Distribute & Pip, the next development tool that you should install is `virtualenv <http://pypi.python.org/pypi/virtualenv/>`_. Use pip::
40
+
After Distribute & Pip, the next development tool that you should install is
41
+
`virtualenv <http://pypi.python.org/pypi/virtualenv/>`_. Use pip::
29
42
30
43
$ pip install virtualenv
31
44
32
-
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.
45
+
The virtualenv kit provides the ability to create virtual Python environments
46
+
that do not interfere with either each other, or the main Python installation.
47
+
If you install virtualenv before you begin coding then you can get into the
48
+
habit of using it to create completely clean Python environments for each
49
+
project. This is particularly important for Web development, where each
50
+
framework and application will have many dependencies.
33
51
34
-
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::
52
+
To set up a new Python environment, change the working directory to where ever
53
+
you want to store the environment, and run the virtualenv utility in your
54
+
project's directory::
35
55
36
56
$ virtualenv --distribute venv
37
57
38
-
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.
58
+
To use an environment, run ``source venv/bin/activate``. Your command prompt
59
+
will change to show the active environment. Once you have finished working in
60
+
the current virtual environment, run ``deactivate`` to restore your settings
61
+
to normal.
39
62
40
-
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.
63
+
Each new environment automatically includes a copy of ``pip``, so that you can
64
+
setup the third-party libraries and tools that you want to use in that
65
+
environment. Put your own code within a subdirectory of the environment,
66
+
however you wish. When you no longer need a particular environment, simply
67
+
copy your code out of it, and then delete the main directory for the environment.
41
68
42
69
43
70
--------------------------------
44
71
45
-
This page is a remixed version of `another guide <http://www.stuartellis.eu/articles/python-development-windows/>`_, which is available under the same license.
72
+
This page is a remixed version of `another guide <http://www.stuartellis.eu/articles/python-development-windows/>`_,
Copy file name to clipboardExpand all lines: docs/starting/install/osx.rst
+57-16Lines changed: 57 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,44 +5,69 @@ Installing Python on Mac OS X
5
5
6
6
The latest version of Mac OS X, Lion, **comes with Python 2.7 out of the box**.
7
7
8
-
You do not need to install or configure anything else to use Python. Having said that, I would strongly recommend that you install the tools and libraries described in the next section before you start building Python applications for real-world use. In particular, you should always install Distribute, as it makes it much easier for you to use other third-party Python libraries.
8
+
You do not need to install or configure anything else to use Python. Having
9
+
said that, I would strongly recommend that you install the tools and libraries
10
+
described in the next section before you start building Python applications
11
+
for real-world use. In particular, you should always install Distribute, as it
12
+
makes it much easier for you to use other third-party Python libraries.
9
13
10
-
The version of Python that ships with OS X is great for learning, but it's not good for development. It's slightly out of date, and Apple has made significant changes that can cause hidden bugs.
14
+
The version of Python that ships with OS X is great for learning, but it's not
15
+
good for development. It's slightly out of date, and Apple has made significant
16
+
changes that can cause hidden bugs.
11
17
12
18
Doing it Right
13
19
--------------
14
20
15
21
Let's install a real version of Python.
16
22
17
-
First, you'll need to have GCC installed to compile Python. You can either get this from `XCode <http://developer.apple.com/xcode/>`_ or the smaller `OSX-GCC-Installer <https://github.com/kennethreitz/osx-gcc-installer#readme>`_ package.
23
+
First, you'll need to have GCC installed to compile Python. You can either get
24
+
this from `XCode <http://developer.apple.com/xcode/>`_ or the smaller
While Lion comes with a large number of UNIX utilities, those familiar with Linux systems will notice one key component missing: a decent package manager. `Homebrew <http://mxcl.github.com/homebrew/>`_ fills this void.
27
+
While Lion comes with a large number of UNIX utilities, those familiar with
28
+
Linux systems will notice one key component missing: a decent package manager.
29
+
`Homebrew <http://mxcl.github.com/homebrew/>`_ fills this void.
20
30
21
-
To `install Homebrew <https://github.com/mxcl/homebrew/wiki/installation>`_, simply run::
31
+
To `install Homebrew <https://github.com/mxcl/homebrew/wiki/installation>`_,
Then, insert the hombrew directory at the top of your ``PATH`` enviornment variable. You can do this by adding the following line at the bottom of your ``~/.bashrc`` file::
36
+
Then, insert the hombrew directory at the top of your ``PATH`` enviornment
37
+
variable. You can do this by adding the following line at the bottom of your
38
+
``~/.bashrc`` file::
26
39
27
40
export PATH=/usr/local/bin:$PATH
28
41
29
42
Now, we can install Python 2.7: ::
30
43
31
44
$ brew install python --framework
32
45
33
-
This will take a minute or two. Once that's complete, you'll have to add the new Python scripts directory to your ``PATH``::
46
+
This will take a minute or two. Once that's complete, you'll have to add the
47
+
new Python scripts directory to your ``PATH``::
34
48
35
49
export PATH=/usr/local/share/python:$PATH
36
50
37
-
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 is built as a Framework, so this helps avoid some future module installation bugs.
51
+
The ``--framework`` option tells Homebrew to compile a Framework-style Python
52
+
build, rather than a UNIX-style build. The outdated version of Python that
53
+
Snow Leopard comes packaged with is built as a Framework, so this helps avoid
54
+
some future module installation bugs.
38
55
39
56
40
57
Distribute & Pip
41
58
----------------
42
59
43
-
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.
60
+
The most crucial third-party Python software of all is Distribute, which
61
+
extends the packaging and installation facilities provided by the distutils
62
+
in the standard library. Once you add Distribute to your Python system you can
63
+
download and install any compliant Python software product with a single
64
+
command. It also enables you to add this network installation capability to
65
+
your own Python software with very little work.
44
66
45
-
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.
67
+
Hombrew already installed Distribute for you. Its ``easy_install`` command is
68
+
considered by many to be deprecated, so we will install its replacement:
69
+
**pip**. Pip allows for uninstallation of packages, and is actively maintained,
70
+
unlike easy_install.
46
71
47
72
To install pip, simply open a command prompt and run::
48
73
@@ -52,21 +77,37 @@ To install pip, simply open a command prompt and run::
52
77
Virtualenv
53
78
----------
54
79
55
-
After Distribute & Pip, the next development tool that you should install is `virtualenv <http://pypi.python.org/pypi/virtualenv/>`_. Use pip::
80
+
After Distribute & Pip, the next development tool that you should install is
81
+
`virtualenv <http://pypi.python.org/pypi/virtualenv/>`_. Use pip::
56
82
57
83
$ pip install virtualenv
58
84
59
-
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.
85
+
The virtualenv kit provides the ability to create virtual Python environments
86
+
that do not interfere with either each other, or the main Python installation.
87
+
If you install virtualenv before you begin coding then you can get into the
88
+
habit of using it to create completely clean Python environments for each
89
+
project. This is particularly important for Web development, where each
90
+
framework and application will have many dependencies.
60
91
61
-
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::
92
+
To set up a new Python environment, change the working directory to where ever
93
+
you want to store the environment, and run the virtualenv utility in your
94
+
project's directory::
62
95
63
96
$ virtualenv --distribute venv
64
97
65
-
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.
98
+
To use an environment, run ``source venv/bin/activate``. Your command prompt
99
+
will change to show the active environment. Once you have finished working in
100
+
the current virtual environment, run ``deactivate`` to restore your settings
101
+
to normal.
66
102
67
-
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.
103
+
Each new environment automatically includes a copy of ``pip``, so that you can
104
+
setup the third-party libraries and tools that you want to use in that
105
+
environment. Put your own code within a subdirectory of the environment,
106
+
however you wish. When you no longer need a particular environment, simply
107
+
copy your code out of it, and then delete the main directory for the environment.
68
108
69
109
70
110
--------------------------------
71
111
72
-
This page is a remixed version of `another guide <http://www.stuartellis.eu/articles/python-development-windows/>`_, which is available under the same license.
112
+
This page is a remixed version of `another guide <http://www.stuartellis.eu/articles/python-development-windows/>`_,
0 commit comments