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

That used to be the very hacky and unclean way of getting it to work.

I have tested this just now and the current steps are as Campbell said. Since it now builds a proper module you can either add it to your PYTHONPATH environment variable or to your sys.path prior to import.

  1. Build the Python module make bpy
  2. Open a terminal and run python to get the interpreter prompt
  3. import sys and then append both the path to <some prefix>\build_windows_Bpy_x64_vc16_Release\bin\Release and <some prefix>\build_windows_Bpy_x64_vc16_Release\bin\Releas\bpy with calls to sys.path.append(<put string var here>).
  4. Import the module with import bpy

These steps are not necessary when the paths are in PYTHONPATH since Python will already check there on its own (they are automatically getting added to sys.path).

  1. Add paths to PYTHONPATH
  2. Start a Python interpreter
  3. Use import bpy
1 Like