18

I made a standalone software using python3.9 which properly works on my system and another windows 10 system also, but I tried running that software on Windows 7 Ultimate and it shows some errors. Please note that I made the software by binding all the required python modules using PyInstaller. Those errors are as follows:

  1. Error loading Python DLL 'C:\Users\hp\AppData\Local\Temp_MEI19602\python39.dll'. LoadLibrary: The specified module could not be found.
  2. The program can't start because api-ms-win-core-path-l1-1-0.dll is missing from your computer. Try reinstalling the program to fix this problem.

What can I do to run this program on Windows 7?

Basj
  • 41,386
  • 99
  • 383
  • 673
Tushar Agarwal
  • 191
  • 1
  • 1
  • 7

2 Answers2

14

Times has come and may be you should learn how to build from the source:

Discussion: https://www.reddit.com/r/Python/comments/rbhd2n/python_39_310_on_windows_7/

Both solutions above use code from the Wine project to emulate missing functions (PathCchCanonicalizeEx, PathCchCombineEx, PathCchSkipRoot) on Windows 7.

PS:

Errors around api-ms-win-core-path-l1-1-0.dll and a such basically requires to install a particular vcredist_x86.exe/vcredist_x64.exe. But specifically that error in the Python 3.9 is because the DLL is a part of windows 8.

Andry
  • 2,273
  • 29
  • 28
  • @Basj If it would been existed then it would already be known. The team has dropped support for a reason and one of important reasons is absence of maintenance and security update in near future from the OS manufacturer. Another reason is continuously increasing effort to support multiple OSes and dependencies. In other words folks with old OSes are on it's own. So either you trust to 3dparty builds or build on your own. Just like in the Linux or Unix. This is it. – Andry Feb 21 '22 at 14:47
  • @Basj I don't think it would work. The Python DLL already has a linkage with some of functionality inside the API DLL which has no implementation in early OS version, so it would complain about of absence an import table function. And it would complain on functions which it does use, why link with the functions you does not use in first place, it has no sense. – Andry Feb 21 '22 at 16:01
  • @Basj You can use `Process Hacker` or `Process Explorer` to lookup the list of DLLs has loaded into Python instance. – Andry Feb 22 '22 at 01:50
  • @Basj I am not familiar with Windows 10 loader, but it might load import section somehow dynamically. – Andry Feb 22 '22 at 02:20
  • 2
    *"you should learn how to build from the source"*. Funny story: I need to build my own Firefox, because they removed some CSS code I used to colorize tabs. Now the build system (that breaks literally every second FF update) updated to python3.9, so now I'd have to compile python3.9 to compile Firefox, so I can change the color of tabs. Oh I love it. – user136036 May 26 '22 at 08:10
10

If you check out the Python documentation, you will see that Python 3.9 is not supported on Windows 7:

As specified in PEP 11, a Python release only supports a Windows platform while Microsoft considers the platform under extended support. This means that Python 3.9 supports Windows 8.1 and newer. If you require Windows 7 support, please install Python 3.8.

You can read more here.

Jacob Lee
  • 4,405
  • 2
  • 16
  • 37
  • Does it also mean that any software using Python 3.9 will not work on Windows 7? – Tushar Agarwal Mar 20 '21 at 04:19
  • @TusharAgarwal Yes. Unfortunately, that is correct. – Jacob Lee Mar 20 '21 at 14:24
  • 18
    In Windows7 is easy to skip the KB updates what violate user privacy. In Windows 8 and 10 that privacy violation can not be skipped... I do not know in what are thinking Python 3.9 developers isolating Windows 7 but the result is sadly pretty bad. By other side, technically speaking, **Windows7 keep being covered by paid Extended Support Updates** (ESU) till 2023 ( and one variant till 2024), why block it?. Will Python developers block Windows10 v1809 and above? it would be a no sense, isn't it?, why then with Windows7 – ClassicOcean May 23 '21 at 20:54
  • 1
    @ClassicOcean there is nothing intentionally "blocked". The pre-built Python binary from python.org just happens to be incompatible with Windows 7. One can easily build any Python version themselves from sources or pay someone to do that. – fpbhb Sep 24 '21 at 17:49
  • Forcing each user to build, pay? puff, what a pile of 'good intentions', thank you. I stopped using Python for new projects, as it stopped being a widely supported scripting language (and this precedents are not a good signal). Anyway, if someone is trying to get Python 3.9 in windows 7, would be needed to take a look to the api-ms-win-core-path-l1-1-0.dll hack https://github.com/nalexandru/api-ms-win-core-path-HACK , as other comments indicated. I noticed its existence through Blender 3.x for windows7 https://github.com/nalexandru/BlenderCompat , what saved me as Blender user (thanks guys). – ClassicOcean Feb 07 '23 at 01:29
  • @ClassicOcean [PEP 11](https://peps.python.org/pep-0011/) was published in 2002 before Windows 8 (2012), 10 (2015), or 11 (2021) were released, whereas Microsoft decided to end support for Windows 7 in 2020. I doubt the PSF intended to "force" anyone to upgrade their operating system. Rather, they presumably deemed it, in advance, unnecessary to support operating systems whose manufacturers weren't actively maintaining. – Jacob Lee Feb 08 '23 at 07:32
  • 2
    @Jacob Lee, VSCode (Microsoft) also blocked win7 installations some months ago. Microsoft employs five core developers for Python, and many more CPython contributors: Is Python Owned By Microsoft? http://web.archive.org/web/20211027095944/https://pythonin1minute.com/is-python-owned-by-microsoft/ , the creator of Python came back from retirement and joined the developer team at Microsoft in Nov 2020. Programmers are not politicians nor lawyers, but have mouth what to feed. Those with win10 will suffer the politics when Python4.22 blocks them, https://news.ycombinator.com/item?id=34712640 – ClassicOcean Feb 10 '23 at 06:20