How to Compile Python Files Into EXE!

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2024

Комментарии • 14

  • @48_subhambanerjee22
    @48_subhambanerjee22 7 месяцев назад +5

    Cool. Now i can distribute my ml application for my college project... ❤❤❤❤ Thanks a lot brother

    • @beginsecure
      @beginsecure  7 месяцев назад +1

      You're welcome. Good luck on your project.

  • @greglumley8249
    @greglumley8249 Месяц назад +1

    Clear and to the point - The way tutorials should be, thank you.

    • @beginsecure
      @beginsecure  Месяц назад

      Thank you for your kind words and for watching. Take care!!

  • @bentpigeon
    @bentpigeon Месяц назад

    Can I get some help resolving AttributeError: module 'helper' has no attribute 'display_message'. I wrote the code exactly the same as in this tutorial but I can't explain the error

    • @beginsecure
      @beginsecure  Месяц назад

      Let's see if this helps by double-checking a few things:
      1 Ensure that display_message is properly defined in the helper.py file.
      2 Verify that you're importing helper correctly in your main script (import helper).
      3 Make sure the spelling and capitalization match exactly between the function definition and where you call it.
      If everything seems correct, try restarting your IDE or clearing any cached Python files. Let me know how it goes and good luck.

  • @MikeMike-qd8bf
    @MikeMike-qd8bf 5 месяцев назад +1

    Over 7Mb for a couple Lines of Code!?!? Is ist possible to reduce the size of the .exe?

    • @beginsecure
      @beginsecure  5 месяцев назад +2

      There are a few things you can try:
      1. Minimize the number of libraries and modules your script imports. For example, importing large libraries like Pandas and Numpy can significantly increase the size of the executable. Only import the necessary parts of a library instead of the entire library.
      2. Use the --exclude-module option in PyInstaller to exclude unnecessary modules that are not used in your script.
      3. PyInstaller creates a.spec file that includes details about how the.exe is built. Review this file to see if there are any unnecessary inclusions and remove them if possible.
      Good luck, let us know how it goes.

    • @nutzernime
      @nutzernime Месяц назад

      write in C

  • @maryksh8250
    @maryksh8250 3 месяца назад +1

    it does not work with me

    • @beginsecure
      @beginsecure  3 месяца назад +1

      What problem are you having, or error messages are you seeing?

    • @maryksh8250
      @maryksh8250 3 месяца назад

      @@beginsecure I do not see any error. The main file turns into an executable file, but when I run the executable file, the first interface appears, which is a login interface and some data. When I log in, the other interface for the project does not appear. The first interface I programmed with a different Python file than the second interface's Python file. I created a project that contains several Python files, and when I run the project using Bycharm, it runs without any difficulty facing me, but when I convert it to an executable file, only the first interface of the main file works.

    • @beginsecure
      @beginsecure  3 месяца назад +1

      @@maryksh8250 Thanks for reaching out! Since you're using PyInstaller, it sounds like the issue might be related to how your project’s multiple Python files are being bundled. Sometimes, PyInstaller might not include all the necessary files or dependencies automatically. I’d recommend double-checking that all your Python files are properly imported in the main script. You might also want to ensure that any external resources or files are included by using the --add-data option in PyInstaller. Additionally, check for any path issues-using absolute paths can help. If you're still having trouble, let me know, and I'll be happy to assist further!

    • @maryksh8250
      @maryksh8250 2 месяца назад

      @@beginsecure thank you , i will try it