|
2 | 2 | Getting Started
|
3 | 3 | +++++++++++++++
|
4 | 4 |
|
5 |
| -Get Python 3.5 |
6 |
| -============== |
| 5 | +Python 3.5 (or higher) only |
| 6 | +=========================== |
7 | 7 |
|
8 |
| -Sorry but this documentation is written for Python 3.5 to avail of the new |
9 |
| -``async`` |
10 |
| -and ``await`` keywords. |
| 8 | +This documentation is written for Python 3.5 to avail of the new |
| 9 | +``async`` and ``await`` keywords. |
| 10 | + |
| 11 | +If you have Python 3.5 installed you only need to install ``aiohttp``:: |
| 12 | + |
| 13 | + pip install -U aiohttp |
| 14 | + |
| 15 | +If you don't have Python 3.5 installed yet, you have several options |
| 16 | +to install it. |
| 17 | + |
| 18 | +All platforms with ``conda`` |
| 19 | +---------------------------- |
| 20 | + |
| 21 | +* Download and install |
| 22 | + `Miniconda <http://conda.pydata.org/miniconda.html>`_ for our platform. |
| 23 | +* Create a new Python 3.5 environment (named ``aio35``, use a different |
| 24 | + if you like):: |
| 25 | + |
| 26 | + conda create -n aio35 python=3.5 |
| 27 | + |
| 28 | +* Activate it. |
| 29 | + Linux and OS X:: |
| 30 | + |
| 31 | + $ source activate aio35 |
| 32 | + |
| 33 | + Windows:: |
| 34 | + |
| 35 | + $ source activate aio35 |
| 36 | + |
| 37 | +* Install ``aiohttp``:: |
| 38 | + |
| 39 | + $(aio35) pip install aiohttp |
| 40 | + |
| 41 | +Platform specific |
| 42 | +----------------- |
11 | 43 |
|
12 | 44 | .. would be good to have some word about installing on Windows
|
13 |
| -* Windows: the easiest way to use Python 3.5 would be to use a package manager |
14 |
| - like Conda |
15 |
| - There are instructions for using a python 3.5 environment in `Conda here |
16 |
| - <http://conda.pydata.org/docs/py2or3.html#create-a-python-3-5-environment>`_. |
17 |
| -* Mac OS X: install `Homebrew </usr/bin/ruby -e "$(curl -fsSL |
| 45 | +* Windows: The easiest way to use Python 3.5 would be to use a package manager |
| 46 | + such as conda. See the installation instructions above. |
| 47 | +* Mac OS X: Install `Homebrew </usr/bin/ruby -e "$(curl -fsSL |
18 | 48 | https://raw.githubusercontent.com/Homebrew/install/master/install)">`_ and
|
19 |
| - then type ``brew install python3`` |
| 49 | + then type ``brew install python3``- |
20 | 50 | * Linux: Ubuntu 16.04+ and Arch linux ship with Python 3.5 included.
|
21 | 51 | If you don't have Python 3.5+ on your computer, you can compile it or use
|
22 |
| - `Pythonz <https://github.com/saghul/pythonz>`_ |
| 52 | + `Pythonz <https://github.com/saghul/pythonz>`_. |
23 | 53 |
|
24 | 54 |
|
25 | 55 | Create a virtual environment to run examples
|
26 | 56 | ============================================
|
27 | 57 |
|
28 |
| -Create a virtual environment:: |
| 58 | +If you don't use conda (see above), create a virtual environment:: |
29 | 59 |
|
30 | 60 | python3 -m venv venv
|
31 | 61 |
|
32 | 62 | .. note::
|
33 |
| - Depending on your platform, the python 3 interpreter could be invoked by |
34 |
| - ``python`` instead. This is the case for Conda on Windows for example. |
| 63 | + Depending on your platform, the Python 3 interpreter could be invoked by |
| 64 | + ``python`` instead. This is the case for conda on Windows for example. |
35 | 65 |
|
36 |
| -Install aiohttp in the virtual environment:: |
| 66 | +Install ``aiohttp`` in the virtual environment:: |
37 | 67 |
|
38 | 68 | venv/bin/python -m pip install -U aiohttp
|
39 | 69 |
|
0 commit comments