2

Good day, everyone!

I made a python script in my Windows 10 laptop that exports sql data into text file. The script was compiled into an executable file via the pyinstaller python package. The exe runs perfectly on my laptop with no issues. However, when I copy/pasted the directory of the exe files in to another laptop (with Windows 7 OS) and run it, errors occur. So, I tried to install python and all the packages I've installed in my laptop to run the script. Yet, the errors remain. Please check the ss of the errors below.

When I run the exe file this pops up enter image description here

If I click OK, two pop ups appear with the same content enter image description here

To tell you the truth, this is my first time writing a python script so I may be missing some important details. Please, do explain to me how I can fix these errors. Thank you in advance!

[UPDATE] I tried to copy/paste the raw python script (pyw) and compiled it to exe on the Windows 7 laptop itself. The error being shown this time when I run the new exe file is "Failed to execute script transfer_out_exporting". No other details are given.

jr.prog
  • 69
  • 1
  • 13
  • what does your reasearch tell you about the missing dll file? – jsotola Oct 26 '20 at 07:23
  • @jsotola So far I've searched about the api-ms-win-core-path-l1-1-0.dll. The most common reason according to the wiki dll is: "Error messages related to the api-ms-win-core-path-l1-1-0.dll file can also indicate that the file has been incorrectly installed, corrupted or removed". The site gave me the option to download an app that can repair that file so I attempted to download it but it requires an activation key which is both in the app's website. I have not yet researched about the python dll – jr.prog Oct 26 '20 at 07:30
  • 1
    i would never download an app for repairing dll files from some random website ... look for a solution at a microsoft site – jsotola Oct 26 '20 at 07:48
  • @jsotola Could it be possible that the root of the problem is the Python version? I installed a lower version of Python on the Windows 7 laptop because the latest version won't install on Windows 7 and lower OS version – jr.prog Oct 26 '20 at 07:59
  • Most likely a duplicate of https://stackoverflow.com/questions/17023419/windows-7-64-bit-dll-problems. You should install the redistributable on the *Win 7* machine. – CristiFati Oct 26 '20 at 08:37

2 Answers2

1

Problem Solved

First, I copied the raw python file (pyw) and compiled it on the Windows 7 laptop itself. This solved the api-ms-win-core dll and python dll issues. Then, I added the read and write files that the exe uses for some data referencing.

The exe was running after doing those steps. I think I was overthinking the problem when I simply had to look at my script. Make sure to always check your script!

jr.prog
  • 69
  • 1
  • 13
0

Python 3.9 does not seem to be supported on Windows 7 anymore. At least Python 3.7 works on Windows 7 (I don't know about Python 3.8). So, you could compile the program on e.g. Windows 10 within an (anaconda) environment using Python 3.7 and pyinstaller and the resulting compiled program should work on Windows 7.

tardis
  • 1,280
  • 3
  • 23
  • 48