pyinstaller shows a solution to the incompatibility problem in win7

pyinstaller shows a solution to the incompatibility problem in win7

question:

After using pyinstaller to package in the win11 computer, the following pop-up window appears in the computer copied to the win7 32-bit system

Please add a picture description

Solution:

By installing a virtual machine, run win7 32-bit system in the virtual machine, and use python 3.6.8 for packaging

  1. Download VMware 16 and install

Link: https://pan.baidu.com/s/1ryialUCHgvwspb2-fCX8LQ?pwd=hty7
Extraction code: hty7

  1. Download the win7 image file and install it in the virtual machine,

Link: https://pan.baidu.com/s/1U03P66I61wv0TO4nsYwZig?pwd=hty7
Extraction code: hty7

  1. Download python 3.6.8 and install it in the win7 32-bit system environment, add environment variables (there are many online tutorials but not too many descriptions)

Link: https://pan.baidu.com/s/1vfyUO8vNu9vtMFgON_e5QQ?pwd=hty7
Extraction code: hty7

  1. Update pip in the win7 virtual machine and install pyinstaller. If the installation is slow, you can add Tsinghua source, etc.
# 更新pip
python -m pip install --upgrade pip
# 安装pyinstaller
pip install pyinstaller
# 使用清华源 安装pyinstaller
pip install pyinstaller -i https://pypi.tuna.tsinghua.edu.cn/simple
  1. Transfer the py file to the win7 virtual machine through file transfer, and use pyinstaller to package the file

Please add a picture description

# 将文件打包成单个文件,没有黑框
pyinstaller -F -w main.py 
  1. The packaging is complete, and there is a separate executable exe file in the dist folder. This file can run on win7 32-bit system
    Please add a picture description

Notice:

  • VMware 16 cannot install VM-tools, you can transfer files through the following, if you can install, please let me know how, thank you!
    • Air Portal : https://airportal.cn/ (when connected to the Internet)
    • Cow transfer: https://cowtransfer.com/ (with internet connection)
    • Feem: https://feem.io/ (when not connected to the Internet)
  • Before packaging the program, the relevant libraries must be installed first, otherwise an error will be reported, and pay attention to the version issue

Guess you like

Origin blog.csdn.net/qq_42578742/article/details/127803664