question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] pip install fails on atari-py

See original GitHub issue

🐛 Bug

Fresh install of extra from pip fails on atari-py.

UPDATE: Using the current master from git seems to work: pip install git+https://github.com/DLR-RM/stable-baselines3#egg=stable-baselines3[extra]

To Reproduce

On a fresh install: pip install 'stable-baselines3[extra]' produces the following error:

WARNING: The candidate selected for download or install is a yanked version: 'atari-py' candidate (version 0.2.6 at https://files.pythonhosted.org/packages/43/dd/2721f34a89dc520d2e09363fd23d110a33bbab2399e50fdced6eb2ed2157/atari-py-0.2.6.tar.gz#sha256=6249ad5079b0489e87eb44e65485bb1b07cc1b5af729f1ee52ece749503ceb1d (from https://pypi.org/simple/atari-py/))
Reason for being yanked: re-release with new wheels
Building wheels for collected packages: atari-py
  Building wheel for atari-py (setup.py): started
  Building wheel for atari-py (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: ~/venv/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mw/fr9y9vy938b9pq99vq56rp000000gn/T/pip-install-4krkiw32/atari-py_89e87b2aae6b424c8b41a316c5a1417f/setup.py'"'"'; __file__='"'"'/private/var/folders/mw/fr9y9vy938b9pq99vq56rp000000gn/T/pip-install-4krkiw32/atari-py_89e87b2aae6b424c8b41a316c5a1417f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/mw/fr9y9vy938b9pq99vq56rp000000gn/T/pip-wheel-40utx24i
       cwd: /private/var/folders/mw/fr9y9vy938b9pq99vq56rp000000gn/T/pip-install-4krkiw32/atari-py_89e87b2aae6b424c8b41a316c5a1417f/

If I try to install gym manually, based on this line, I get the following error:

Installing collected packages: tqdm, click, gym-notices, AutoROM.accept-rom-license, autorom, gym
  Attempting uninstall: gym
    Found existing installation: gym 0.19.0
    Uninstalling gym-0.19.0:
      Successfully uninstalled gym-0.19.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
stable-baselines3 1.4.0 requires gym<0.20,>=0.17, but you have gym 0.22.0 which is incompatible.

Expected behavior

Would love to see Successfully installed

### System Info

>>> sb3.get_system_info()
OS: macOS-12.1-x86_64-i386-64bit Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64
Python: 3.8.12
Stable-Baselines3: 1.4.0
PyTorch: 1.10.2
GPU Enabled: False
Numpy: 1.22.2
Gym: 0.22.0

({'OS': 'macOS-12.1-x86_64-i386-64bit Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64', 'Python': '3.8.12', 'Stable-Baselines3': '1.4.0', 'PyTorch': '1.10.2', 'GPU Enabled': 'False', 'Numpy': '1.22.2', 'Gym': '0.22.0'}, 'OS: macOS-12.1-x86_64-i386-64bit Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64\nPython: 3.8.12\nStable-Baselines3: 1.4.0\nPyTorch: 1.10.2\nGPU Enabled: False\nNumpy: 1.22.2\nGym: 0.22.0\n')

Additional context

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have read the documentation (required)
  • I have provided a minimal working example to reproduce the bug (required)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
araffincommented, Feb 25, 2022

stable-baselines3 fully supports M1 mac

stable-baselines3 is a python only package, so as long as you manage to install pytorch, you can use SB3. The issue is with atari-py from the [extra] requirements. As M1 is an arm processor (vs intel processor usually), some pre-built binaries may be missing. @aaronbannin I think this is your issue too. And because ale-py comes with pre-built binaries for arm, the new SB3 version (1.4.1a1) works with M1 too 😉

1reaction
aaronbannincommented, Feb 23, 2022

Yup!

Successfully installed AutoROM.accept-rom-license-0.4.2 absl-py-1.0.0 ale-py-0.7.4 autorom-0.4.2 cachetools-5.0.0 certifi-2021.10.8 charset-normalizer-2.0.12 click-8.0.4 cloudpickle-2.0.0 cycler-0.11.0 fonttools-4.29.1 google-auth-2.6.0 google-auth-oauthlib-0.4.6 grpcio-1.44.0 gym-0.21.0 idna-3.3 importlib-metadata-4.11.1 importlib-resources-5.4.0 kiwisolver-1.3.2 markdown-3.3.6 matplotlib-3.5.1 numpy-1.22.2 oauthlib-3.2.0 opencv-python-4.5.5.62 packaging-21.3 pandas-1.4.1 pillow-9.0.1 protobuf-3.19.4 psutil-5.9.0 pyasn1-0.4.8 pyasn1-modules-0.2.8 pyparsing-3.0.7 python-dateutil-2.8.2 pytz-2021.3 requests-2.27.1 requests-oauthlib-1.3.1 rsa-4.8 six-1.16.0 stable-baselines3-1.4.1a1 tensorboard-2.8.0 tensorboard-data-server-0.6.1 tensorboard-plugin-wit-1.8.1 torch-1.10.2 tqdm-4.62.3 typing-extensions-4.1.1 urllib3-1.26.8 werkzeug-2.0.3 wheel-0.37.1 zipp-3.7.0
Read more comments on GitHub >

github_iconTop Results From Across the Web

What the error 'Failed building wheel for atari-py?' #11 - GitHub
Only the 'pip install atrati-py' and can`t been installed. Tanks!
Read more >
python 3.x - Failed building wheel for atari-py - Stack Overflow
I'm using conda on Mac OS to build a python3.6 environment and I meet the same failed building wheel for atari-py.
Read more >
atari-py - PyPI
Python bindings to Atari games. ... pip install atari-py. Copy PIP instructions. Latest version. Released: May 20, 2021. Python bindings to Atari games ......
Read more >
Hands-On Reinforcement Learning with Python [Book] - O'Reilly
If you get these errors, just run the following commands and try reinstalling: Failed building wheel for pachi-py or Failed building wheel for...
Read more >
How do I install ray[rllib] without atari-py?
Hi. I'm using rllib in a project. Is there a way to install rllib using pip, but without the example environments, especially the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found