AWS Lambda python: .so module: ModuleNotFoundError: No module named 'regex._regex' when in subshell

The problem come from the binary having /usr/bin/python3 in its shebang and pointing to python3.6, so python3.6 can't load .so compiled for python3.7

Strangely even though the Lambda was deployed with python3.7 runtime. In lambda python3.7 is located in /var/lang/bin/python3.7 , so for the moment I have modify my CI to symlink python3.7 in /var/lang/bin/python3.7 so the shebang generated by pip is the correct one for lambda,