How do I make Python aware of `bpy.pyd` (Windows) internals?

I have built Blender’s API as a Python module, and produced a Release bpy.pyd. Upon placing this in Lib\site-packages\bpy. I can now import bpy successfully. However, I am unable to load any of the modules associated with bpy, for instance from bpy.types import Action, will give me an error ModuleNotFoundError: No module named 'bpy.types'. Similarly, after doing a import bpy, running a script with only the line bpy.types.Action gives the error: AttributeError: module 'bpy' has no attribute 'types'.

If I start up IPython, import bpy, then type bpy. in the console and hit Tab for auto-completion, no auto-complete options show up.

If I am interpreting the Python docs correctly, there is nothing more for me to do once I make Python aware of the bpy.pyd. So, what’s going wrong? Why is Python not aware of the “detail” contained in bpy.pyd?

You would also need to copy the DLLs and the .\2.92 directory as shown in the Wiki, but exclude the python3.dll and python37.dll.

The exact steps are:

  1. In Blender’s git repository run make bpy
  2. In the build folder you will find the bpy.pyd, BlendThumb.dll, libfftw3-3.dll, libgmp-10.dll, libgmpxx.dll, tbb.dll, tbbmalloc.dll, tbbmalloc_proxy.dll. These need to be copied into the directory where your python.exe is located, e.g. C:\Program Files\Python37.
  3. In the build folder you will find the .\2.92 subdirectory that contains the scripts and data files. This directory needs to be copied into C:\Program Files\Python37 as well.