PufferLib icon indicating copy to clipboard operation
PufferLib copied to clipboard

Atari is a funny (broken) environment

Open KTibow opened this issue 6 months ago • 3 comments

Error A:

ImportError: No module named 'ale_py'

This is probably an installation error. Try: pip install pufferlib[AtariEnv]. Note that some environments have non-python
dependencies. These are included in PufferTank. Or, you can install manually by following the instructions provided by the
environment meaintainers. But some are finicky, so we recommend using PufferTank.

Resolution: actually install pufferlib[atari], not pufferlib[AtariEnv]

Error B:

warning: No `requires-python` value found in the workspace. Defaulting to `>=3.13`.
  × No solution found when resolving dependencies for split (python_full_version >= '3.13' and sys_platform == 'linux'):
  ╰─▶ Because ale-py==0.9.0 has no wheels with a matching Python version tag (e.g., `cp313`) and pufferlib[atari]==3.0.0
      depends on ale-py==0.9.0, we can conclude that pufferlib[atari]==3.0.0 cannot be used.
      And because only pufferlib[atari]==3.0.0 is available and your project depends on pufferlib[atari], we can conclude
      that your project's requirements are unsatisfiable.

      hint: Wheels are available for `ale-py` (v0.9.0) with the following Python ABI tags: `cp38`, `cp39`, `cp310`,
      `cp311`, `cp312`
  help: If you want to add the package regardless of the failed resolution, provide the `--frozen` flag to skip locking
        and syncing.

Resolution: use ale-py with a version of at least 0.10.1, when cp313 wheels started

Error C:

APIUsageError: num_workers (16) > hardware cores (12) is disallowed by default. PufferLib multiprocessing is heavily
optimized for 1 process per hardware core. If you really want to do this, set overwork=True (--vec-overwork in our
demo.py).

Resolution: don't hardcode the number of workers in atari.ini - use automatic values, like the number of cores available, instead

KTibow avatar Jul 16 '25 20:07 KTibow

--vec.num-workers=4 can be used with puffer train.

--vec-overwork: demo.py was removed in favor of the command which uses pufferlib/pufferl.py.

elevatorguy avatar Jul 18 '25 00:07 elevatorguy

Hey! I'd like to help fix this. I can tackle all three errors:

Error A: Update the error message to reference pufferlib[atari] instead of pufferlib[AtariEnv] Error B: Bump ale-py dependency to >=0.10.1 for Python 3.13 wheel support Error C: Make worker count in __atari.ini__ dynamic (use available CPU cores instead of hardcoded 16)

Should I submit these as one PR or split them into separate ones? Happy to do whichever you prefer.

jacobarrio avatar Nov 04 '25 01:11 jacobarrio

you should be good to submit it in a single PR.

leanke avatar Nov 04 '25 01:11 leanke