If you do not create a virtual environment, the packaged exe
file is very large, so you need to create a virtual environment.
The steps to establish a virtual environment are as follows:
View the virtual environment:
conda info --envs
conda create -n auto python==3.8
# Create a virtual environment auto named myself
The created virtual environment is under envs
in the anaconda installation directory:
# Activate the virtual environment
conda activate auto
# Exit the virtual environment
conda deactivate
# delete virtual environment
conda remove -n aotu--all
Install the required packages in the virtual environment
pip install pyinstaller
Switch to the place where the code and ico pictures are stored: use this command to package
Pyinstaller -F -i a.ico a.py
after packaging: