- name: Install Python packages
  become: yes
  become_user: root
  apt:
    name: '{{item}}'
    state: latest
  with_items:
    - python-pip
    - python-dev
    - python3-dev
    - python-virtualenv
    - pkg-config
    - libfreetype6-dev
  tags: [python]

- name: Install pip packages
  become: yes
  become_user: root
  pip:
    name: '{{item}}'
    state: latest
  with_items:
    - pip
    - fabric
    - docopt
    - cqlsh==4.1.1
    - flake8
    - requests[security] # or else SSL warnings
  tags: [python]

- name: Install pip3 packages
  become: yes
  become_user: root
  pip:
    name: '{{item}}'
    state: latest
    executable: pip3
  with_items:
    - jupyter
    - pandas
    - matplotlib
    - proselint
  tags: [python]

- name: Install Python packages
  become: yes
  become_user: root
  apt:
    name: '{{item}}'
    state: latest
  with_items:
    - python-pip
    - python-dev
    - python3-dev
    - python-virtualenv
    - pkg-config
    - libfreetype6-dev
  tags: [python]

- name: Install pip packages
  become: yes
  become_user: root
  pip:
    name: '{{item}}'
    state: latest
  with_items:
    - pip
    - fabric
    - docopt
    - cqlsh==4.1.1
    - flake8
    - requests[security] # or else SSL warnings
  tags: [python]

- name: Install pip3
  become: yes
  become_user: root
  easy_install:
    name: pip
    executable: easy_install3
  tags: [python]

- name: Install pip3 packages
  become: yes
  become_user: root
  pip:
    name: '{{item}}'
    state: latest
    executable: pip3
  with_items:
    - jupyter
    - pandas
    - matplotlib
    - proselint
  tags: [python]

Use easy_install to install pip3
[python] Use easy_install to install pip3
