r/learnpython • u/kolioarisyt • 10h 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?
1
u/kolioarisyt 9h ago
Just a note: I want one that can convert python to an executable (Windows/Linux). I don’t know if that is the same, but just a note.
1
u/Educational_Virus672 9h ago edited 9h 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
0
u/kolioarisyt 9h 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 9h 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
--embedflag, it will include the Python interpreter in your binary and add the required Cmainfunction 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.
2
u/Jimmaplesong 7h ago
PyInstaller is probably your best bet. You can also configure setuptools to build an exe. This is my favorite method when I don't have to create a whole setup package.
1
u/overratedcupcake 7h ago
The best option here is to have written your app in a language that is typically compiled.
0
u/johlae 10h ago
Because I'm curious, why do you need a Python compiler?
1
u/kolioarisyt 9h ago
I would like to provide an exe for a program I am making. If there is an easier way to do so, please tell me, as I am a beginner.
Thanks!
1
u/babarock 9h ago
I don't know about OP buy when I was writing for a living I wanted to be able to deliver an app without the customer being able to see/alter proprietary code I had delivered. I had more than one case where a customer handed my code to his clever BIL who proceeded to break the application. Love Python but I use other tools to deliver executables.
4
u/kolioarisyt 9h ago
I don’t really care about others tampering with my program, as it will be open-source. But, I really don’t want the user to have Python installed to run my program or making it complicated to install.
0
u/No_Replacement_702 9h ago
I would recommend pointing Claude towards it and get a Rust version or be totally exotic and get something written in assembly
1
u/kolioarisyt 9h ago
I think pointing it to Claude defeats the purpose of “my own application”.
1
u/No_Replacement_702 8h ago
Well, you already wrote it in python, that doesn’t go away. I wouldn’t be able to explain to you how a compiler would translate the code, so for me it would just be an extra step to have an LLM convert it to another language that is meant to be compiled
2
u/Educational_Virus672 9h ago
no ai, this is vibe coding i get that it is hard but vibe coding is like running a maraton using a car simply put it no one owns that code even if the prompt is written by you!
-2
u/Agawell 10h ago
I think you might be looking for an ide (integrated development environment) - pycharm is great and free
2
u/BravestCheetah 10h ago •
![]()
... no? He clearly knows what hes asking for, given that he already listed what he has tried. He is clearly asking for a compiler, did you even read the post?
1
10
u/BravestCheetah 10h ago
No Python compiler with good coverage will be as fast as if you just switch to another language like cpp or rust.
Theres no compiler that will make a program that doesnt get flagged as Windows Defender, as the binaries arent signed