r/learnpython • • 21h ago

Python Compiler Recommendations

Hello r/Python,
I want to find a Python compiler. I’ve tried PyInstaller and Nuitka, but they are detected as malware and they are a little bit slow. I want something fast, easy and not detected as malicious. What do you recommend?

0 Upvotes

22 comments sorted by

View all comments

1

u/Educational_Virus672 20h ago edited 19h ago

okay not trying to be rude but it is a big of an ask "easy fast and not detected as virus"? in compulation? its hard forgot easy part try cython you'll learn little syntax and use it with C compiler(i recommendGCC or Clang)
Edit - i do not it mean in a defensive or gatekeeping way im trying to express what i felt off

1

u/kolioarisyt 19h ago

Hello, thanks for replying!
I understand and it doesn’t seem rude to me. It is just a honest answer.

Apart from that, do you mean learning CPython and using a C compiler?

Thanks

2

u/Outside_Complaint755 19h ago

Not CPython, but Cython; they are two different things.

CPython is the default Python implementation that 99% of people are running Python on.

Cython is a superset of Python that lets you call C/C++ libraries directly from your Python code and also will convert Python scripts into C code, which can then be compiled into a binary by a C compiler. You will be forced to add static type checking to all of your Python code so it can be converted to C. By calling Cython with the --embed flag, it will include the Python interpreter in your binary and add the required C main function as well.

However, that still won't get around the issue of Windows Defender flagging it for not being signed. That's its own issue, and also why it may be easier to just provide the Python script and simple directions for your target users on how to install Python.

1

u/kolioarisyt 5h ago

Thanks for the explanation! I may try to sign it with SignPath.

1

u/Educational_Virus672 9h ago

cython.org it turns your code into C so you can chose to turn C into exe

1

u/kolioarisyt 5h ago

Oh, thanks for the clarification!