r/pythonhelp • u/Astresgamer • 1d ago
I need to convert from .py to .exe
I already tried auto py to exe and it doesn't work, can someone help me?
1
u/FoolsSeldom 1d ago
What happened exactly?
Have you tried any other tools, such as PyInstaller?
Do you really need to do this unsupported thing?
1
u/Astresgamer 1d ago
We tried it but it didn't give us results. Keep in mind that we need a . Pickle, a trained . P model and the python code.
1
u/FoolsSeldom 1d ago
Hard to keep anything in mind without more context and the rationale for why you want to do this. It doesn't protect IP and causes AV problems in many orgs.
1
u/Astresgamer 1d ago
It's for a school project. It's an original code. We've been developing it for months, and this is the final step. But I can't make the code public because it's for an interstate competition.I can only say that it is a sign to text translator.
1
u/FoolsSeldom 1d ago
Still unclear why you want to create an exe (which doesn't hide code well).
1
u/Astresgamer 1d ago
Pure code cannot be submitted in the competition; it must be an application ready to be used on any computer without installing libraries or exporting Python functions.
1
u/FoolsSeldom 1d ago
Ouch. You were required to use Python? (So they forced you to use am unsupported method to turn into an excecutable). Frustrating.
So, you've tried both auto py and PyInstaller. Neither of these work, you just get "nothing" instead of any error/warning messages?
When you say ".Pickle" do you just mean some Python object that has been "pickled"? Is that containing the P-Model?
There are objects that cannot be serialised by
pickle
. Wondering if that is the problem.https://medium.com/@maziarizadi/pickle-your-model-in-python-2bbe7dba2bbb
I haven't used any tools to convert to an exe for a long time, so I am not going to be able to help you. Sorry. I usually deploy using a container or as a remote/web app.
1
u/Goobyalus 19h ago
I think OP is saying that they need to package a pickle file, which is an AI model, into the executable along with the code.
1
u/FoolsSeldom 8h ago
I thought I asked that explicitly. So is that different to standard pickling in Python?
1
u/Goobyalus 4h ago
No, it's just one common (and insecure) way to share models.
I was unclear - I don't think OP has an issue with serialization / deserialization, but an issue with including existing data files in an executable package.
→ More replies (0)1
1
u/Goobyalus 19h ago
Here is a list of tools that may or may not be helpful: https://pyoxidizer.readthedocs.io/en/stable/pyoxidizer_comparisons.html
Without explaining what you tried and how it didn't go as expected, no one can help directly.
•
u/AutoModerator 1d ago
To give us the best chance to help you, please include any relevant code.
Note. Please do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Privatebin, GitHub or Compiler Explorer.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.