deep-rl-class icon indicating copy to clipboard operation
deep-rl-class copied to clipboard

Add conditional import for pickle5 in unit-2 hands-on

Open bodoque-01 opened this issue 1 year ago • 0 comments

This PR resolves installation failures when setting up the Unit 2 hands-on exercise requirements. The current pickle5 dependency causes build errors on Python 3.8+, since the package is no longer required for modern Python versions and Google Colab already runs Python 3.10+.

In case a student decides to do the hands-on exercise locally instead of doing it in Colab and happens to have a Python version older than 3.8, the PR code will work just as fine because of the dynamic requirement installation based on Python's version being used.

Approach:

  • Uses conditional requirement: pickle5; python_version < "3.8"
  • Implements graceful fallback import pattern
  • Maintains compatibility with all Python versions"

Testing:

  • [x] Verified installation works on Python 3.10+ (Colab environment)
  • [x] Confirmed backward compatibility approach

bodoque-01 avatar Jul 12 '25 08:07 bodoque-01