After building bpy under windows, module seems to be incomplete and throws "DLL load failed ..." on load

Hi,
I’ve built blender from the blender-v4.1-release branch (I need to build it on multiple machines so I try to have a fixed version).

The build finishes without errors:

...
Build succeeded.

C:\programming\blender-git\blender\source\blender\blenkernel\intern\mesh_legacy_convert.cc(2294,22): warning C4805: '!=': unsafe mix of type 'char' and type 'bool' in operation [C:\programming\blender-git\build_windows_Bpy_x64_vc16_Release\source\blender\blenkernel\bf_blenkernel.vcxproj]
    1 Warning(s)
    0 Error(s)

Time Elapsed 00:42:13.62

Then I moved the bpy folder to my site-package, but there seems to be a DLL missing:

>>> import bpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed while importing bpy: The specified module could not be found.

Somebody on the discord channel said there is supposed to be a bpy.dll in the folder, but there isn’t in mine. But I am not sure if that is the error or not since the build finished without errors.

Did you build the INSTALL target?

If you use make bpy it will do that automatically. But from the build output, I’m guessing you maybe manually did the build in Visual Studio, or used some other command.

I did use make bpy.

I also did make update and a make which generated a working Blender build. It’s just the bpy that seems to be incomplete or just copying the folder into site-packages is not enough? (the windows part of the bpy installation is kinda short)

Also sorry for the late response, my old one generated a 403 error and it seemed like I was unable to post.

Is there a way to see which .dll is missing? Or is there supposed to be a bpy.dll, because then I know it wasn’t generated.

__init__.pyd is the bpy.dll, just with a different name and extension. Though I think the error message really is referring to other dlls that are missing.

You could try comparing the contents of your bpy folder to the one from the official wheel. You can rename .whl to .zip to extract it.

What version of python did you install it into?

I used a python 3.10, because that was in what was written in the docs, but I think it should have been 3.11 (docs are also updated to 311 in the path, now).
I will check it with 3.11 (since that’s what the prebuilt whl is built for).

But for my application the 4.1 bpy from pip did work, so the priority to also build it on windows from sources (I developed my scripts on an ubuntu) is much lower now for me right now.