# How to specify collection versions in requirements.yml that are compatible with my versions of ansible/python

**URL:** <https://forum.ansible.com/t/how-to-specify-collection-versions-in-requirements-yml-that-are-compatible-with-my-versions-of-ansible-python/39604>\
**Category:** Get Help\
**Tags:** ee, galaxy-ng\
**Created:** [January 14, 2025, 4:57pm UTC](https://forum.ansible.com/t/how-to-specify-collection-versions-in-requirements-yml-that-are-compatible-with-my-versions-of-ansible-python/39604 "2025-01-14T16:57:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smatterchew](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/smatterchew/32/7207_2.png) [@smatterchew](https://forum.ansible.com/u/smatterchew)\
**Post date:** [January 14, 2025, 4:57pm UTC](https://forum.ansible.com/t/how-to-specify-collection-versions-in-requirements-yml-that-are-compatible-with-my-versions-of-ansible-python/39604/1 "2025-01-14T16:57:50Z")

</div>

**How to install collections that are compatible with the version of ansible-core and python in my EE container**.

IIRC, for a python `requirements.txt` file you can specify a python module version restriction that is compatible with the version of python used to install the module.

I am looking for the same type of functionality (if it exists) to limit the versions of collections installed using the `collections\requirements.yml` file.

I know I can specify limits on a collection version with:

```auto
---
collections:
  - name: foo.bar
    version: ">=2.2.0,<3.0.0"

```

This will install newest version of `foo.bar` that is less than version 3.

Is there a way to have `ansible-galaxy` _also_ limit a collection version to what is compatible with the version of `ansible-core` and `python` that is installed in the container? For instance:

```auto
collections:
  - name: foo.bar
    version: ">=2.2.0,<3.0.0,ansible=2.15,python=3.9"

```

This doesn’t work but should illustrate my point.

Follow-on question. **How do you keep track of what collection versions are compatible with your version of Ansible and Python?**

Thank you!
