edbeeching/godot_rl_agents

[Temporary solution] Numpy error on training in Windows: UserWarning: Failed to initialize NumPy: _ARRAY_API not found

Closed this issue · 2 comments

There may currently be an issue with installing Godot RL on Windows, if you get the following error when starting training with gdrl:

UserWarning: Failed to initialize NumPy: _ARRAY_API not found

and/or this error:

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Until we can get this fixed, you can try going into the conda env / venv where gdrl is installed, and type:

pip install "numpy<2

If it still doesn't work, you could try downgrading torch, but this is likely not needed on reasonably newer PCs (the CPU I just tested this on is quite old):

pip install "torch<2"

Ah this is why the tests are broken on Windows. I will take a look.

Fixed in #192