The executable file with py2exe does not start on windows xp 32bit

I created an executable file with py2exe on a 64-bit Windows 7 machine and distributed the program.

On a Windows xp 32bit machine, the program refuses to work, exhibiting the following behavior:

A popup says: program.exe is an invalid win32 application.

The command prompt says: “Access denied”

I checked the permissions and the user has full control and full ownership of the file and its parent directories. So this may not be a problem.

The only possible opportunity I can make is OS / architecture mismatch. How to fix it?

My setup.py file used to generate the executable:

from distutils.core import setup import py2exe setup(console=['xerxes2excel.py']) 

I created the following command to generate exe:

 python setup.py py2exe 
+6
source share
2 answers

I think you just need to install 32-bit python and 32-bit py2exe on your computer .... see Can 64-bit python create 32-bit Windows executables

+7
source

A common problem when creating an executable file in Windows 7 and deploying to Windows XP.

According to the py2exe tutorial, you need to enable the MVC DLL. But the tutorial is out of date, and the script is given a search in only one directory. Previously, the directory contained the entire DLL and manifest, but currently it contains only the DLL. You need to specify a different directory for the manifest file. If you do not, you will have this error:

 this application has failed to start because the application configuration is incorrect 

If you are using 64-bit versions of Windows 7, you will need the Microsoft Visual C runtime DLL. Do not forget the manifest, which is not in the same directory in Windows 7. You need to adapt the script as follows:

 data_files = [("VC90", glob(r'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91\*.*')), ("VC90", glob(r'C:\Windows\winsxs\Manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91.manifest')) ] setup( data_files=data_files, console = [{'script': "C:\test\my_program.py"}], zipfile = None, ) 

Now you can expand the "dist" directory containing all the files and dependencies.

+4
source

Source: https://habr.com/ru/post/890713/


All Articles