Problem with importing a library on Windows Server 2016

Currently I’m solving a problem with Python and extra libraries importing. So, I’ve downloaded a package of external libraries that are needed to work with Foresight Analytics Platform using Python.

These libraries work only with Python 3.7.8, so I’ve installed it and added the path to external libraries to the paths of this interpreter in Pycharm (the path is C:\Platforms\9.9.220\Interops\python).

Then I type “from foresight.metabase import *” (where “foresight” is the name of the library, and “metabase” is one of its modules).

And when I try to use any of the classes from “metabase” I get the mistake: ImportError: DLL load failed: The specified procedure could not be found.

So as I understand, the problem is connected with reading .pyd files

The PC I’m working with is Windows Server 2016. One interesting fact is that I’ve done all the steps I’ve described before on another PC, Windows Server 2019 and it worked smoothly.
Maybe I need to install a special C++ compiler?

What docs are available for the library? Are you sure it’s the same Python version, and CPU architecture on both machines?

It’s a bit trickier to build extensions from source on Windows, than on Linux, but if you do get the right compiler, and if it can find it, setuptools (or even a setup.py) might -just- work. 5. Building C and C++ Extensions on Windows — Python 3.15.0a2 documentation

It’s far easier to work from what you know works though. And if setuptools doesn’t -just- work, I’d be more inclined to upgrade the operating system personally.

1 Like

Unfortunately, there is no proper documentation for the library itself but the developers (who gave me the files package) claim it’s exactly for Python 3.7.8. Undoubtedly, Python is the same on both machines (and so are the versions of setuptools). Speaking of CPU, I’m not even sure how to check that… I’ll try anyway. Thank you!

You’re very welcome. The CPU will likely be x64 or x86. Some newer Windows machines could be ARM.

If building from source, I think the key is, to use the same version of MS Visual Studio, as the Python you’re targeting was compiled with (3.7.8). Have fun.