Python program I wrote in python3.7/Windows 7 won't run in Windows XP

264 Views Asked by At

I wrote a python 3.7 script under Windows 7 and compiled it using auto-py-to-exe. I can run the .exe with no problem in my computer but when my co-worker tries to run it under Windows XP there is an error: "The procedure entry point GetFinalPathNameByHandleW could not be located in the dynamic link library Kernel32.dll"

Is this because XP doesn't support python 3.7? From what I know, XP supports only up to 3.4 but I can't rewrite the code with python 3.4 because then one of the libraries I used is unsupported.

Is there any way I can make it work on XP or is the problem something else?

1

There are 1 best solutions below

0
Alvaro Lopez On BEST ANSWER

Those kinds of error messages mean that the program is looking "inside" the specified file (in this case kernel32.dll) trying to find a function/procedure to run called 'GetFinalPathNameByHandleW' and not finding it.

Either the program is calling the wrong nonexistent function or the library file doesn't have it in there. Things are not matching up somewhere.

A DLL is a Dynamic Link Library and files like kernel32.dll are sometimes just a bunch of functions/procedures/subroutines all lumped into one portable file.

In a primitive way, you can use a text editor to open the kernel32.dll file (make a copy if it your desire) and search for a string 'GetFinalPathNameByHandleW' and you will not find it.

So your program is calling a function inside a DLL but that function does not exist in the Windows XP kernel32.dll.

I think GetFinalPathNameByHandleW was introduced in Windows Vista, so going forward from there you would be fine.

If you want your program to work on XP, you need to stick to functions that are part of XP and GetFinalPathNameByHandleW ain't in there hence the error.