# Segmentation Fault Python 3.13 venv

**URL:** <https://forum.ansible.com/t/segmentation-fault-python-3-13-venv/44436>\
**Category:** Get Help\
**Tags:** ansible-galaxy, fedora, network, galaxy-ng\
**Created:** [September 8, 2025, 12:56pm UTC](https://forum.ansible.com/t/segmentation-fault-python-3-13-venv/44436 "2025-09-08T12:56:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeamHall](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/leamhall/32/9390_2.png) [@LeamHall](https://forum.ansible.com/u/LeamHall)\
**Post date:** [September 8, 2025, 12:56pm UTC](https://forum.ansible.com/t/segmentation-fault-python-3-13-venv/44436/1 "2025-09-08T12:56:39Z")

</div>

Created a fresh Python 3.13 (3.13.0a2) venv, used pip to install ansible, and then tried to use ansible-galaxy:

```auto
(venv_313) [me@here tmp]$ ansible-galaxy collection list
Segmentation fault (core dumped)

```

Tried the same with Python 3.12 and it worked. Both Python versions were fresh installs from native Fedora 37 rpms.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [September 8, 2025, 2:25pm UTC](https://forum.ansible.com/t/segmentation-fault-python-3-13-venv/44436/2 "2025-09-08T14:25:20Z")

</div>

I tried with latest stable Python

```auto
#>python --version
Python 3.13.7

```

and

```auto
#>ansible-galaxy collection list

# ... collections/ansible_collections
Collection Version
-------------------- -------
ansible.netcommon 8.0.1  
ansible.utils 6.0.0  
bcoca.collection *      
bcoca.fw *      
bcoca.getent2 1.0.0  
bcoca.harden *      
bcoca.misc 0.0.1  
bcoca.sysmaint *      
bcoca.libvirt 0.1
community.crypto 3.0.3  
containers.podman 1.17.0 

```

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [September 8, 2025, 2:38pm UTC](https://forum.ansible.com/t/segmentation-fault-python-3-13-venv/44436/3 "2025-09-08T14:38:19Z")

</div>

What’s the output from `PYTHONFAULTHANDLER=1 ansible-galaxy collection list`?

Is it specific to Fedora 37 (which is EOL)?

---

<div class="post-metadata">

**Author:** ![LeamHall](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/leamhall/32/9390_2.png) [@LeamHall](https://forum.ansible.com/u/LeamHall)\
**Post date:** [September 8, 2025, 3:03pm UTC](https://forum.ansible.com/t/segmentation-fault-python-3-13-venv/44436/4 "2025-09-08T15:03:10Z")

</div>

shertel:

```auto
(venv_313) [leam@shaphan tmp]$ PYTHONFAULTHANDLER=1 ansible-galaxy collection list
Fatal Python error: Segmentation fault

Current thread 0x00007f97b0010740 (most recent call first):
  File "/home/leam/tmp/venv_313/lib64/python3.13/site-packages/yaml/cyaml.py", line 26 in __init__
  File "/home/leam/tmp/venv_313/lib64/python3.13/site-packages/yaml/ __init__.py", line 79 in load
  File "/home/leam/tmp/venv_313/lib64/python3.13/site-packages/ansible/config/manager.py", line 387 in _read_config_yaml_file
  File "/home/leam/tmp/venv_313/lib64/python3.13/site-packages/ansible/config/manager.py", line 319 in __init__
  File "/home/leam/tmp/venv_313/lib64/python3.13/site-packages/ansible/constants.py", line 20 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1010 in exec_module
  File "<frozen importlib._bootstrap>", line 929 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1325 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1354 in _find_and_load
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1409 in _handle_fromlist
  File "/home/leam/tmp/venv_313/lib64/python3.13/site-packages/ansible/cli/ __init__.py", line 86 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1010 in exec_module
  File "<frozen importlib._bootstrap>", line 929 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1325 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1354 in _find_and_load
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1304 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1354 in _find_and_load
  File "/home/leam/tmp/venv_313/bin/ansible-galaxy", line 5 in <module>

Extension modules: markupsafe._speedups, yaml._yaml (total: 2)
Segmentation fault (core dumped)

```

and:

```auto
cat venv/bin/ansible-galaxy 

#!/home/leam/tmp/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from ansible.cli.galaxy import main
if __name__ == ' __main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

```

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [September 8, 2025, 3:46pm UTC](https://forum.ansible.com/t/segmentation-fault-python-3-13-venv/44436/5 "2025-09-08T15:46:34Z")

</div>

PyYAML added support for Python 3.13 only recently and Python 3.13.0a2 is old and preview. I would try upgrading to a stable version.

---

<div class="post-metadata">

**Author:** ![LeamHall](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/leamhall/32/9390_2.png) [@LeamHall](https://forum.ansible.com/u/LeamHall)\
**Post date:** [September 8, 2025, 10:55pm UTC](https://forum.ansible.com/t/segmentation-fault-python-3-13-venv/44436/6 "2025-09-08T22:55:35Z")

</div>

I can back it down to 3.12, but I’m saddened that the ecosystem is so fragile.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [September 9, 2025, 12:40am UTC](https://forum.ansible.com/t/segmentation-fault-python-3-13-venv/44436/7 "2025-09-09T00:40:34Z")

</div>

Alpha versions are fragile by nature
