Running cross build of python

I have done cross build of python from windows cygwin with target platform as linux. I am unable to use some functionalities of cross compiled python. when I do an import of a module say math it says no module found. When I manually do cd to Modules directory containing math.cpython-312d.so it works. also I am unable to run the unittests using command ./python -m test, as it fails with no modules found.

import _socket
ModuleNotFoundError: No module named '_socket'

I am using --enable-shared option for cross compiling.

do I need to set some variables before running cross compiled python. I am new to cross compilation, any help would be appreciated.

If you’re new to cross compiling then CPython probably isn’t a good place to start.

FWIW, I’d recommend you install either WSL or Docker Desktop to virturalise Linux then just build from there.

Thank you, @bwoodsend