Example of Python Installation Using C2 Platform's Windows Role
An example of how to install Python 3.13.3 using the C2 Platform’s WinCore collection.
Categories:
Projects: c2platform/phx/ansible
,
c2platform.core
The following example is part of the PHX inventory project
c2platform/phx/ansible
,
located in the file
/master/group_vars/win_devtop/python.yml
. It utilizes the win_resources
variable from the C2 Platform Ansible collection
c2platform.core
to download and install Python.
---
px_python_path: "{{ px_apps_dir }}/Python313"
win_resources:
1_python:
- name: Download Python
type: win_get_url
url: https://www.python.org/ftp/python/3.13.3/python-3.13.3-amd64.exe
dest: "{{ px_download_temp_dir['path'] }}/python-3.13.3-amd64.exe"
checksum: be3264daeb8c5e08365492dd02908cfa
checksum_algorithm: md5
- name: Install Python
type: win_package
path: "{{ px_download_temp_dir['path'] }}/python-3.13.3-amd64.exe"
arguments: '/quiet InstallAllUsers=1 PrependPath=1 TargetDir="{{ px_python_path | c2platform.core.replace_slashes }}"'
creates_path: "{{ px_python_path }}"
C:\Users\vagrant>python --version
Python 3.13.3
C:\Users\vagrant>pip --version
pip 25.0.1 from D:\Apps\Python313\Lib\site-packages\pip (python 3.13)
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified May 26, 2025: phx python and python venv PHX-6 (0e3904b)