# 2023-09-12 update-to-python-3.9.18

**URL:** <https://forum.dimagi.com/t/2023-09-12-update-to-python-3-9-18/10156>\
**Category:** Maintainer Announcements\
**Created:** [September 19, 2023, 8:49am UTC](https://forum.dimagi.com/t/2023-09-12-update-to-python-3-9-18/10156 "2023-09-19T08:49:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aphulera](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/aphulera/32/2498_2.png) [@aphulera](https://forum.dimagi.com/u/aphulera)\
**Post date:** [September 19, 2023, 8:49am UTC](https://forum.dimagi.com/t/2023-09-12-update-to-python-3-9-18/10156/1 "2023-09-19T08:49:48Z")

</div>

# 74. [update-to-python-3.9.18](https://commcare-cloud.readthedocs.io/en/latest/changelog/0074-update-to-python-3.9.18.html#update-to-python-3-9-18)

## [Change Context](https://commcare-cloud.readthedocs.io/en/latest/changelog/0074-update-to-python-3.9.18.html#change-context)

Installs python 3.9.18 and build a new virutalenv for CommCare HQ

## [Details](https://commcare-cloud.readthedocs.io/en/latest/changelog/0074-update-to-python-3.9.18.html#details)

Python 3.9.18 applies some security patches to the known CVEs in earlier versions of Python 3.9. Performing these steps will ensure that that those CVEs don’t affect your environment

## [Steps to update](https://commcare-cloud.readthedocs.io/en/latest/changelog/0074-update-to-python-3.9.18.html#steps-to-update)

1. Update to the latest commcare-cloud
2. Install Python 3.9.18, update supervisor configs and sudoers file, and create virtualenv for CommCare HQ:

```auto
cchq <env> deploy-stack --tags=python

```

It will do a dry run, after which you can review the changes and enter ‘y’ to apply. 3. Restart services:

```auto
cchq <env> service commcare restart

```
