Home > Back-end >  problem with creating .exe file in python why it gets too big
problem with creating .exe file in python why it gets too big

Time:11-21

i'm making archives to .exe using pyinstaller, but i have a big problem, every time I create a file, its size multiplies, it seems that it is multiplying the libraries, does anyone know how to solve it?

1° file size: 7mb 2° file size: 52mb 3° file size: 104mb 4° file size: 207mb 5° file size: 414mb 6° file size: 828mb 7° file size: 1.656mb 8° file size: 3.312mb

I tried to rename the files, deleted %tmp% files

CodePudding user response:

It would be good to know your commandline e.g. "pyinstaller --" I use it myself with the option --clean btw. If this does not help it would be an option to use "rmdir" before.

CodePudding user response:

You can try AutoPyToExe

with python's virtual environment plugin

follow these commands:

  1. Install, Create and Activate Virtual Environment:

python -m pip install virtualenv

python -m venv example_env

example_env/Scripts/activate

  1. Install AutoPyToExe:

(example_env) python -m pip install auto-py-to-exe

  1. To run AutoPyToExe, just write this command in Command Prompt or Terminal:

(example_env) auto-py-to-exe

  1. Important: Installing only those modules in the virtual environment which are required by the project.

  2. Working with virtualenv in python:

  • Activate virtual environment using this command:

    Linux: <path_to_virtual_env>\bin\activate

    Windows: <path_to_virtual_env>\Scripts\activate

  • Deactivate virtual environment using this command:

    deactivate

  • Related