How to compile a universal version of Python 3.8 (for both Mac M1 and Intel)

Hello,
I'm new to Xcode and the universe of Mac, and I have a new Mac M1.
I want, if it's possible, to compile my own version of Python 3.8, in order to have a Universal 2 version that I can use in my own Mac (without using Rosetta 2), for better performance and discover how to compile an app.
But I don't know how to to do and which files I need.
So, could you help me ?

Thanks,
CcaS
Answered by crlab in 654519022
Python is a complex project. I would suggest you get a pre-compiled version for your platform. A good place to start would be the miniforge distribution which includes a version compiled for arm64 (Apple Silicon). However, you may find that many modules do yet support this architecture (e.g. Pandas), some that do support it are built using experimental compilers (gcc/gFortran) that may have issues or poor performance. Even core modules like numpy exhibit some bugs on the M1, and some native functions perform a magnitude slower than the same function run as translated code (which suggest low hanging fruit for optimization). It seems like these issues are getting rapidly resolved, but in the short term I would suggest sticking with the translated Python unless you are explicitly trying to resolve these limitations.
Accepted Answer
Python is a complex project. I would suggest you get a pre-compiled version for your platform. A good place to start would be the miniforge distribution which includes a version compiled for arm64 (Apple Silicon). However, you may find that many modules do yet support this architecture (e.g. Pandas), some that do support it are built using experimental compilers (gcc/gFortran) that may have issues or poor performance. Even core modules like numpy exhibit some bugs on the M1, and some native functions perform a magnitude slower than the same function run as translated code (which suggest low hanging fruit for optimization). It seems like these issues are getting rapidly resolved, but in the short term I would suggest sticking with the translated Python unless you are explicitly trying to resolve these limitations.
You don't need Python to compile apps. The previous post by crlab is optimistic at best.
Hello @crlab,
Thank's to your answer,
I think that I'll wait one or two months, in order to have modules without bugs for my Apple Silicon Mac.
Thank's for your answer both !
CcaS
How to compile a universal version of Python 3.8 (for both Mac M1 and Intel)
 
 
Q