PyInstaller: ImportError: cannot import name 'ccompiler' from partially initialized module 'numpy.distutils'

Solution 1:

Try to collect all submodules of Numpy

--collect-submodules numpy

then, you may get a new error or others

ModuleNotFoundError: No module named 'distutils.unixccompiler'

Adding them to hidden imports

--hidden-import distutils.unixccompiler