Windows SymInitialize() error

I don’t think this is a ray-specific issue, but it does involve ray, so I’m positing here for any help I can find.

I have a pyd DLL built from pybind11. I know pybind11 does not support Py_LIMITED_API.
If this module is imported into a script using ray/rllib, the below SymInitialize() error occurs when entering code contained in _raylet.pyd. This appears to be a Cython-based module.

I tried Python versions from 3.7 through 3.10. Also, I tested on Linux (Ubuntu 22.04, python 3.10), and everything worked fine.

There appears to be an incompatibility between _raylet.pyd (Cython based) and my pybind11 module.

Does anyone have any ideas on this issue?

— Error Output —

2023-09-13 16:44:27,000 INFO -- Started a local Ray instance.
[ : 53] RAW: SymInitialize() failed: 87
Fatal Python error: Aborted

Stack (most recent call first):
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\_private\", line 2281 in connect
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\_private\", line 1657 in init
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\_private\", line 103 in wrapper
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\_private\", line 16 in auto_init_ray
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\_private\", line 23 in auto_init_wrapper
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\", line 536 in remote
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\rllib\evaluation\", line 925 in _make_worker
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\rllib\evaluation\", line 572 in <listcomp>
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\rllib\evaluation\", line 571 in add_workers
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\rllib\evaluation\", line 227 in _setup
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\rllib\evaluation\", line 157 in __init__
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\rllib\algorithms\", line 639 in setup
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\tune\trainable\", line 185 in __init__
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\rllib\algorithms\", line 517 in __init__
  File "C:\Users\mhughes\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\rllib\algorithms\", line 1108 in build
  File "", line 12 in <module>

The same error occurs when I use ray.init(). Could you please let me know whether you have sovled this problems? and How?

The error output shows:
the first 3 error are the same.
lib\site-packages\ray_private\", line 2281 in connect
lib\site-packages\ray_private\", line 1657 in init
\lib\site-packages\ray_private\", line 103 in wrapper

and then:
ray.init() error in my training script.