d3rlpy icon indicating copy to clipboard operation
d3rlpy copied to clipboard

Suppress gym deprecation warning during import

Open viknesh-ai opened this issue 2 months ago • 1 comments

This fixes the issue where importing d3rlpy shows a deprecation warning about gym being unmantained. The fix suppresses stderr during gym imports while maintaining compatibility with both gym and gymnasium.

  • Suppress warning in types.py (early import point)
  • Suppress warning in healthcheck.py
  • Import types module early in init.py to ensure suppression
  • Add safety measure in base.py

viknesh-ai avatar Nov 01 '25 17:11 viknesh-ai

@viknesh-ai Hi, thank you for your contribution! The implementation looks good, but I need you to pass the CI checks. First thing you might need to do is to pass format checks and you can do this as follows:

pip install -r dev.requirements.txt
./scripts/lint

takuseno avatar Nov 02 '25 01:11 takuseno