This can happen when there is a mismatch between the version of python used and the one of cray-python ( currently 3.9.13.1 ) . This is because the packages.yaml does not specify the python version to be used with cray version of cython ( 3.9.13.1 ).
Solution is to specify the version in the config , as in the example below
packages:
py-cython:
externals:
- spec: py-cython@0.29.28 ^python@3.9.13.1
prefix: /opt/cray/pe/python/3.9.13.1