Skip to content Skip to sidebar Skip to footer

Loadlibrary: The Specified Procedure Could Not Be Found

I need to extract some things about system process in a windows 2003 server (yeah, in 2019), I made that code in python, and compiled it with auto_py_to_exe When I run the .exe fil

Solution 1:

There'a too big gap between Python 3.7 and Win 2003. Looking at [Python.Wiki]: WindowsCompilersPython 3.7 is not even listed there (as it's built with VStudio 2017). That, (and Python itself) will require / call functions that are not present in Win 2003 system .dlls.

Here's an example. In the images below I opened 2 versions' (2.7 and 3.7) main .dll with Dependency Walker:

Img0

As seen, both import a bunch of functions from kernel32.dll. But one difference is that python37.dll imports GetTickCount64. According to [MS.Docs]: GetTickCount64 function, the minimum Server version that supports it is Win 2008, meaning that it won't work in Win 2003.

So, you'd have to go way back to python 2.7 (tops). A number of years ago, I've built Python 2.7.10 with VStudio 2010 and it worked on Win 2003 (and XP SP 1); most likely, this also applies to the newest (2.7) version.

Note that you'll also have to install all the packages that you use in your script (including auto-py-to-exe).

@EDIT0:

I remembered (and just checked) that I have Python 3.4.3 on my XP (SP 3) PC. So, there's high chance that Python 3 (prior to 3.5) will work on Win 2003 as well.

@EDIT1:

Finally, I have some official statement: On Python official page, hovering the mouse over the "Download" button yields:

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

or (even clearer):

Img1

Note that it doesn't necessarily mean that older versions are guaranteed to work. So, you'll need to do a bit of testing (I'd recommend installing Python and required packages on the target machine, and only when everything is successful, package everything).

@EDIT2:

I mentioned that I've built a Python2.7 version. psutilwas part of it.

>>> import sys, platform, psutil
>>> sys.version, sys.platform
('2.7.10 (default, Mar  8 2016, 15:08:43) [MSC v.1600 32 bit (Intel)]', 'win32')
>>> platform.platform()
'Windows-XP-5.1.2600-SP3'>>> psutil.__version__
'3.1.1'

I didn't mention that I've built psutil from sources, but the prebuilt .whls and also Win installers are available for download: [PyPI]: psutil 3.1.1 - Download files.

Post a Comment for "Loadlibrary: The Specified Procedure Could Not Be Found"