Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d3d2fcc

Browse files
committed
python 3 guides
1 parent 2994138 commit d3d2fcc

File tree

2 files changed

+150
-0
lines changed

2 files changed

+150
-0
lines changed

docs/starting/install3/linux.rst

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
.. _install3-linux:
2+
3+
Installing Python 3 on Linux
4+
============================
5+
6+
This document describes how to install Python 3.6 on Ubuntu Linux machines.
7+
8+
To see which version of Python 3 you have installed, open a command prompt and run
9+
10+
.. code-block:: console
11+
12+
$ python3 --version
13+
14+
If you are using Ubuntu 16.10 or newer, then you can easily install Python 3.6 with the following commands::
15+
16+
$ sudo apt-get update
17+
$ sudo apt-get install python3.6
18+
19+
If you're using another version of Ubuntu (e.g. the latest LTS release), we recommend using the `deadsnakes PPA <https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes>`_ to install Python 3.6::
20+
21+
$ sudo add-apt-repository ppa:fkrull/deadsnakes
22+
$ sudo apt-get update
23+
$ sudo apt-get install python3.6
24+
25+
26+
Setuptools & Pip
27+
----------------
28+
29+
The two most crucial third-party Python packages are `setuptools <https://pypi.python.org/pypi/setuptools>`_ and `pip <https://pip.pypa.io/en/stable/>`_.
30+
31+
Once installed, you can download, install and uninstall any compliant Python software
32+
product with a single command. It also enables you to add this network installation
33+
capability to your own Python software with very little work.
34+
35+
Python 2.7.9 and later (on the python2 series), and Python 3.4 and later include
36+
pip by default.
37+
38+
To see if pip is installed, open a command prompt and run
39+
40+
.. code-block:: console
41+
42+
$ command -v pip
43+
44+
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.
45+
46+
Virtual Environments
47+
--------------------
48+
49+
A Virtual Environment is a tool to keep the dependencies required by different projects
50+
in separate places, by creating virtual Python environments for them. It solves the
51+
"Project X depends on version 1.x but, Project Y needs 4.x" dilemma, and keeps
52+
your global site-packages directory clean and manageable.
53+
54+
For example, you can work on a project which requires Django 1.10 while also
55+
maintaining a project which requires Django 1.8.
56+
57+
To start using this and see more information: :ref:`Virtual Environments <virtualenvironments-ref>` docs.
58+
59+
You can also use :ref:`virtualenvwrapper <virtualenvwrapper-ref>` to make it easier to
60+
manage your virtual environments.
61+
62+
--------------------------------
63+
64+
This page is a remixed version of `another guide <http://www.stuartellis.eu/articles/python-development-windows/>`_,
65+
which is available under the same license.
66+

docs/starting/install3/win.rst

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
.. _install3-windows:
2+
3+
Installing Python 3 on Windows
4+
============================
5+
6+
First, download the `latest version <https://www.python.org/ftp/python/3.6.0/python-3.6.0.exe>`_
7+
of Python 3.6 from the official website. If you want to be sure you are installing a fully
8+
up-to-date version, click the Downloads > Windows link from the home page of the
9+
`Python.org web site <http://python.org>`_ .
10+
11+
By design, Python installs to a directory with the version number embedded,
12+
e.g. Python version 3.6 will install at :file:`C:\\Python36\\`, so that you can
13+
have multiple versions of Python on the
14+
same system without conflicts. Of course, only one interpreter can be the
15+
default application for Python file types. It also does not automatically
16+
modify the :envvar:`PATH` environment variable, so that you always have control over
17+
which copy of Python is run.
18+
19+
Typing the full path name for a Python interpreter each time quickly gets
20+
tedious, so add the directories for your default Python version to the :envvar:`PATH`.
21+
Assuming that your Python installation is in :file:`C:\\Python36\\`, add this to your
22+
:envvar:`PATH`:
23+
24+
.. code-block:: console
25+
26+
C:\Python36\;C:\Python36\Scripts\
27+
28+
You can do this easily by running the following in ``powershell``:
29+
30+
.. code-block:: console
31+
32+
[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\;C:\Python27\Scripts\", "User")
33+
34+
This is also an option during the installation process.
35+
36+
The second (:file:`Scripts`) directory receives command files when certain
37+
packages are installed, so it is a very useful addition.
38+
You do not need to install or configure anything else to use Python. Having
39+
said that, I would strongly recommend that you install the tools and libraries
40+
described in the next section before you start building Python applications for
41+
real-world use. In particular, you should always install Setuptools, as it
42+
makes it much easier for you to use other third-party Python libraries.
43+
44+
Setuptools + Pip
45+
----------------
46+
47+
The most crucial third-party Python software of all is Setuptools, which
48+
extends the packaging and installation facilities provided by the distutils in
49+
the standard library. Once you add Setuptools to your Python system you can
50+
download and install any compliant Python software product with a single
51+
command. It also enables you to add this network installation capability to
52+
your own Python software with very little work.
53+
54+
To obtain the latest version of Setuptools for Windows, run the Python script
55+
available here: `ez_setup.py <https://bootstrap.pypa.io/ez_setup.py>`_
56+
57+
58+
You'll now have a new command available to you: **easy_install**. It is
59+
considered by many to be deprecated, so we will install its replacement:
60+
**pip**. Pip allows for uninstallation of packages, and is actively maintained,
61+
unlike easy_install.
62+
63+
To install pip, run the Python script available here:
64+
`get-pip.py <https://raw.github.com/pypa/pip/master/contrib/get-pip.py>`_
65+
66+
67+
Virtual Environments
68+
--------------------
69+
70+
A Virtual Environment is a tool to keep the dependencies required by different projects
71+
in separate places, by creating virtual Python environments for them. It solves the
72+
"Project X depends on version 1.x but, Project Y needs 4.x" dilemma, and keeps
73+
your global site-packages directory clean and manageable.
74+
75+
For example, you can work on a project which requires Django 1.10 while also
76+
maintaining a project which requires Django 1.8.
77+
78+
To start using this and see more information: :ref:`Virtual Environments <virtualenvironments-ref>` docs.
79+
80+
81+
--------------------------------
82+
83+
This page is a remixed version of `another guide <http://www.stuartellis.eu/articles/python-development-windows/>`_,
84+
which is available under the same license.

0 commit comments

Comments
 (0)