Skip to content

Commit 39996e8

Browse files
committed
Merge branch 'master' of github.com:kennethreitz/python-guide
2 parents 2b9d469 + e817de1 commit 39996e8

File tree

4 files changed

+38
-11
lines changed

4 files changed

+38
-11
lines changed

docs/starting/install/linux.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,22 @@
33
Installing Python 2 on Linux
44
============================
55

6-
The latest versions of CentOS, Fedora, Redhat Enterprise (RHEL) and Ubuntu
6+
The latest versions of CentOS, Red Hat Enterprise Linux (RHEL) and Ubuntu
77
**come with Python 2.7 out of the box**.
88

99
To see which version of Python you have installed, open a command prompt and run
1010

1111
.. code-block:: console
1212
13-
$ python --version
13+
$ python2 --version
1414
15-
Some older versions of RHEL and CentOS come with Python 2.4 which is
16-
unacceptable for modern Python development. Fortunately, there are
17-
`Extra Packages for Enterprise Linux`_ which include high
18-
quality additional packages based on their Fedora counterparts. This
19-
repository contains a Python 2.6 package specifically designed to install
20-
side-by-side with the system's Python 2.4 installation.
15+
However, with the growing popularity of Python 3, some distributions, such as
16+
Fedora, don't come with Python 2 pre-installed. You can install the ``python2``
17+
package with your distribution package manager:
2118

22-
.. _Extra Packages for Enterprise Linux: http://fedoraproject.org/wiki/EPEL
19+
.. code-block:: console
20+
21+
$ sudo dnf install python2
2322
2423
You do not need to install or configure anything else to use Python. Having
2524
said that, I would strongly recommend that you install the tools and libraries

docs/starting/install3/linux.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,23 @@ If you're using another version of Ubuntu (e.g. the latest LTS release), we reco
2222
$ sudo apt-get update
2323
$ sudo apt-get install python3.6
2424

25+
If you are using other Linux distribution, chances are you already have Python 3
26+
pre-installed as well. If not, use your distribution's package manager.
27+
For example on Fedora, you would use `dnf`:
28+
29+
.. code-block:: console
30+
31+
$ sudo dnf install python3
32+
33+
Note that if the version of the ``python3`` package is not recent enough
34+
for you, there may be ways of installing more recent versions as well,
35+
depending on you distribution. For example installing the ``python36`` package
36+
on Fedora 25 to get Python 3.6. If you are a Fedora user, you might want
37+
to read about `multiple Python versions available in Fedora`_.
38+
39+
.. _multiple Python versions available in Fedora: https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html
40+
41+
2542
Working with Python 3
2643
---------------------
2744

@@ -59,6 +76,17 @@ To see if pip is installed, open a command prompt and run
5976
6077
To install pip, `follow the official pip installation guide <https://pip.pypa.io/en/latest/installing/>`_ - this will automatically install the latest version of setuptools.
6178

79+
Note that on some Linux distributions including Ubuntu and Fedora the ``pip``
80+
command is meant for Python 2, while the ``pip3`` command is meant for Python 3.
81+
82+
.. code-block:: console
83+
84+
$ command -v pip3
85+
86+
However, when using virtual environments (described bellow), you don't need to
87+
care about that.
88+
89+
6290
Virtual Environments
6391
--------------------
6492

docs/starting/install3/win.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ You can do this easily by running the following in ``powershell``:
2929

3030
.. code-block:: console
3131
32-
[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\;C:\Python27\Scripts\", "User")
32+
[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python36\;C:\Python36\Scripts\", "User")
3333
3434
This is also an option during the installation process.
3535

docs/starting/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ for development purposes, as well as setuptools, pip and virtualenv.
2424

2525
- :ref:`Python 2 on MacOS <install-osx>`.
2626
- :ref:`Python 2 on Microsoft Windows <install-windows>`.
27-
- :ref:`Python 2 on Ubuntu Linux <install-linux>`.
27+
- :ref:`Python 2 on Linux <install-linux>`.

0 commit comments

Comments
 (0)