brentvollebregt / auto-py-to-exe

Converts .py to .exe using a simple graphical interface
MIT License
3.95k stars 677 forks source link

Script requiring input #483

Closed olawalejuwonm closed 5 months ago

olawalejuwonm commented 5 months ago

Thanks for the awesome project, I was able to turn my script to exe, but the script needs user input to run, I got this when i try to run the generated exe image

github-actions[bot] commented 5 months ago

👋 Hi, just a reminder that if you haven't read the help post yet, give it a read to see if your issue is covered in it and make sure to follow the debugging section.

Also please note, as stated in the README, if your issue is only associated with your application and not auto-py-to-exe itself, please do not create an issue in this repository - instead, comment on the help post, video or create a new discussion.

brentvollebregt commented 5 months ago

Could you fill out the template you cleared? This will give context for me to help you.

Did you package using windowed mode (no console) - if so, how would you expect the input be entered?

olawalejuwonm commented 5 months ago

Yes I packaged using windowed mode (no console) and removed all print function. I expect that there will be a file picker

My Environment:

brentvollebregt commented 5 months ago

auto-py-to-exe does not add anything extra to your application - it packages as it is. When you packaged using the windowed mode, you asked for there to be no console - this means things like print and input will no longer work by default.


In the debugging steps that was linked in the first comment on this issue, it states,

As basic as it sounds, the first step of debugging is to make sure your script works as a .py file before you package it. This is very important.

And then goes on to say,

If you are wanting to use the "Window Based" option, run your script using pythonw.exe - this executable can be found beside python.exe.

Following this, you would have had issues running your script with Python itself. If it doesn't work with Python, it won't work after packaging.

Outlined under "When running my script with pythonw.exe, it doesn't work", I show how you can redirect print elsewhere. I do not have a solution for input as you would need to build a UI for something like that.

olawalejuwonm commented 5 months ago

How do i build such ui please?

brentvollebregt commented 5 months ago

Python has a built-in library called "tkinter", here is a decent tutorial. There are lots of other libraries too - search "python GUI" in Google to see what else is available.

olawalejuwonm commented 5 months ago

After building with tkinter will I be able to still build with auto-py-to-exe ?

On Tue, May 14, 2024 at 9:26 AM Brent Vollebregt @.***> wrote:

Python has a built-in library called "tkinter", here is a decent tutorial https://realpython.com/python-gui-tkinter/. There are lots of other libraries too - search "python GUI" in Google to see what else is available.

— Reply to this email directly, view it on GitHub https://github.com/brentvollebregt/auto-py-to-exe/issues/483#issuecomment-2109580184, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSQ2BE7MSUKUSTZZFAXTTDZCHDCTAVCNFSM6AAAAABHSJU5L6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBZGU4DAMJYGQ . You are receiving this because you were assigned.Message ID: @.***>

brentvollebregt commented 5 months ago

Yes, tkinter is just a library in Python - you will still be able to package using auto-py-to-exe afterwards.

Alternatively, you could skip needing a GUI if you're fine with providing input in the console. If so, use the console mode.

olawalejuwonm commented 5 months ago

Ok, thanks for the clarification.

Is there a similar library to this auto-py-to-exe that can be used for macOs?

On Tue, May 14, 2024 at 10:23 AM Brent Vollebregt @.***> wrote:

Yes, tkinter is just a library in Python - you will still be able to package using auto-py-to-exe afterwards.

Alternatively, you could skip needing a GUI if you're fine with providing input in the console. If so, use the console mode.

— Reply to this email directly, view it on GitHub https://github.com/brentvollebregt/auto-py-to-exe/issues/483#issuecomment-2109707473, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSQ2BCAJVUCB5LGJ24EFKTZCHJZ3AVCNFSM6AAAAABHSJU5L6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBZG4YDONBXGM . You are receiving this because you were assigned.Message ID: @.***>

brentvollebregt commented 5 months ago

auto-py-to-exe can be used on Mac OS. We use PyInstaller under the hood - you can check out the Mac OS support here: https://pyinstaller.org/en/v4.1/usage.html#building-mac-os-x-app-bundles

olawalejuwonm commented 5 months ago

I mean that can be used for building macOs app

On Tue, May 14, 2024 at 11:12 AM Brent Vollebregt @.***> wrote:

auto-py-to-exe can be used on Mac OS. We use PyInstaller under the hood - you can check out the Mac OS support here: https://pyinstaller.org/en/v4.1/usage.html#building-mac-os-x-app-bundles

— Reply to this email directly, view it on GitHub https://github.com/brentvollebregt/auto-py-to-exe/issues/483#issuecomment-2109811688, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSQ2BCD7YWQCISYB42RXA3ZCHPR3AVCNFSM6AAAAABHSJU5L6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBZHAYTCNRYHA . You are receiving this because you were assigned.Message ID: @.***>

brentvollebregt commented 5 months ago

auto-py-to-exe can build Mac OS X app bundles as described in the link I sent before

olawalejuwonm commented 5 months ago

I've read but I don't understand how to do that, especially specifying the flag. Likewise, will it be possible to build for Mac on windows?

On Tue, May 14, 2024 at 1:18 PM Brent Vollebregt @.***> wrote:

auto-py-to-exe can build Mac OS X app bundles as described in the link I sent before

— Reply to this email directly, view it on GitHub https://github.com/brentvollebregt/auto-py-to-exe/issues/483#issuecomment-2110055823, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSQ2BBLOXGTBLCDWJ5K55LZCH6I5AVCNFSM6AAAAABHSJU5L6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJQGA2TKOBSGM . You are receiving this because you were assigned.Message ID: @.***>

brentvollebregt commented 5 months ago

I've read but I don't understand how to do that, especially specifying the flag.

Use the tool on Mac OS and it will build a Mac OS App Bundle. Use windows mode and the output should then create an OS X application named [myscript].app.

Likewise, will it be possible to build for Mac on windows?

No, this is from the PyInstaller docs,

PyInstaller is tested against Windows, MacOS X, and Linux. However, it is not a cross-compiler; to make a Windows app you run PyInstaller on Windows, and to make a Linux app you run it on Linux, etc.

olawalejuwonm commented 5 months ago

Thanks for the explanation.

On Tue, May 14, 2024 at 1:54 PM Brent Vollebregt @.***> wrote:

I've read but I don't understand how to do that, especially specifying the flag.

Use the tool on Mac OS and it will build a Mac OS App Bundle. Use windows mode and the output should then create an OS X application named [myscript].app.

Likewise, will it be possible to build for Mac on windows?

No, this is from the PyInstaller docs https://pyinstaller.org/en/stable/#pyinstaller-manual,

PyInstaller is tested against Windows, MacOS X, and Linux. However, it is not a cross-compiler; to make a Windows app you run PyInstaller on Windows, and to make a Linux app you run it on Linux, etc.

— Reply to this email directly, view it on GitHub https://github.com/brentvollebregt/auto-py-to-exe/issues/483#issuecomment-2110159147, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSQ2BB6EMX7Y6LKEKNHMYDZCICPBAVCNFSM6AAAAABHSJU5L6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJQGE2TSMJUG4 . You are receiving this because you were assigned.Message ID: @.***>

olawalejuwonm commented 5 months ago

@brentvollebregt I have changed the implementation to use tkinter But this is what I got when I try to run the file image

brentvollebregt commented 5 months ago

A Google search for "pyinstaller the specified module could not be found" brings up this result which describes the same issue you have show.