quetor
quetor

Reputation: 21

Fatal error detected: error loading python dll 'python311.dll'

I try to compile my python script with auto-py-to-exe, and it worked great (on Windows 10). But when i tried to run the program on another computer (on Windows 7). At first there was an error there is not enough 'api-ms-win-core-path-l1-1-0.dll'. When i downloaded this file and put it in base dir, occured new error: Error loading python dll 'python311.dll' and I don't know how to solve this problem.

I tried to search 'python311.dll' and download, but didn't find.

Upvotes: 1

Views: 11766

Answers (2)

user26753531
user26753531

Reputation: 1

I encountered the same error:

[Fatal error detected]
Error loading Python DLL 'C:\Program Files\xxx_internal\python311.dll'
LoadLibrary: The specified module could not be found.

My solution:

I checked the installation directory of this application and found that although I had already put the "_internal" folder into the directory, there was no folder named "_internal". So I moved this folder into the installation directory manually. Finally, the application runs.

Upvotes: 0

CristiFati
CristiFati

Reputation: 41147

According to [Python]: Python Releases for Windows:

Note that Python 3.11.2 cannot be used on Windows 7 or earlier.

This applies to other versions as well.

Alternatives:

1. Upgrade to a newer (and supported) Win version (v10, v11, ...)

This is the recommended way.

According to [MS]: End of support for Windows 7 and Windows 8.1 (emphasis is mine):

After 10 years, security updates and technical support for Windows 7 ended on January 14, 2020.

And the corresponding image (as text is not copyable):

Img0

2. Use an older Python version

This is more like a workaround.

As seen in the 1st URL, some Python versions (v3.8, v3.7, ...) still support Windows 7:

Note that Python 3.8.16 cannot be used on Windows XP or earlier.

Needless to say that:

  • Features introduced in the newer versions won't be available

  • Some (3rd-party) modules might no longer support older Python versions as well. And less and less of them will continue supporting as time goes by

So, this is (or might become) neither manageable nor scalable (on the long run).

3. Try building newer Python versions to run on Windows 7

Only listing this as a (remote) theoretical alternative (best to be avoided).
I'm not sure if it's possible (with / without modifying the code).

But even if it would be possible (you'd also need to make it publicly available somewhere, and not everyone will be willing to install it), maintenance problems would be even greater than for #2..

Related:

Upvotes: 0

Related Questions