Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] pip install fails on atari-py #779

Closed
3 tasks done
aaronbannin opened this issue Feb 19, 2022 · 14 comments · Fixed by #835
Closed
3 tasks done

[Bug] pip install fails on atari-py #779

aaronbannin opened this issue Feb 19, 2022 · 14 comments · Fixed by #835
Labels

Comments

@aaronbannin
Copy link

aaronbannin commented Feb 19, 2022

🐛 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)
@aaronbannin aaronbannin added the bug Something isn't working label Feb 19, 2022
@aaronbannin
Copy link
Author

Using the current master from git seems to work (with some fancy egg info):
git+https://github.com/DLR-RM/stable-baselines3#egg=stable-baselines3[extra]

@Miffyli Miffyli added the Maintainers on vacation Maintainers are on vacation so they can recharge their batteries, we will be back soon ;) label Feb 20, 2022
@Miffyli
Copy link
Collaborator

Miffyli commented Feb 20, 2022

Hmm this might simply be because stable-baselines3 pypi package has not been updated yet (as in: new release has not been made since gym update has been done). @araffin sounds like pretty serious issue, should probably do it asap when you have time?

@araffin araffin removed the Maintainers on vacation Maintainers are on vacation so they can recharge their batteries, we will be back soon ;) label Feb 21, 2022
@araffin
Copy link
Member

araffin commented Feb 21, 2022

Hello,

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

I couldn't reproduce your error following the getting started colab... do you have the build essential package installed? (required for any compilation)

https://colab.research.google.com/github/Stable-Baselines-Team/rl-colab-notebooks/blob/sb3/stable_baselines_getting_started.ipynb

stable-baselines3 1.4.0 requires gym<0.20,>=0.17, but you have gym 0.22.0 which is incompatible.

SB3 1.4.0 requires gym < 0.20, so you should install gym 0.19 if you want to install it manually. And in fact, you need to install atari py manually because the correct version was not specified if I recall.

gym > 0.20 doesn't use atari py anymore...

@aaronbannin
Copy link
Author

@araffin this was using Python installed on OS X, not Colab. I just reproduced with the instructions above on my work machine. This seems like an issue with PyPi propagation; an older version exists in PyPi but installing directly from Github gets the newest version?

python3 -m venv venv
source venv/bin/activate
pip install 'stable-baselines3[extra]'

@araffin
Copy link
Member

araffin commented Feb 23, 2022

an older version exists in PyPi but installing directly from Github gets the newest version?

which version are you talking about? SB3 version?
on PyPi, there is the latest stable release (1.4.0, compatible with gym 0.19) and since yesterday there is also the 1.4.1a1 which is compatible with gym 0.21 (and which uses ale-py instead of atari py)

See https://pypi.org/project/stable-baselines3/#history

@aaronbannin
Copy link
Author

I don't know why pip install 'stable-baselines3[extra]' fails and pip install git+https://github.com/DLR-RM/stable-baselines3#egg=stable-baselines3[extra] succeeds.

@araffin
Copy link
Member

araffin commented Feb 23, 2022

could you try pip install 'stable-baselines3[extra]==1.4.1a1' ?

@aaronbannin
Copy link
Author

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

@araffin
Copy link
Member

araffin commented Feb 23, 2022

As we cannot update SB3 1.4.0 pypi package and that the new version works, I guess the issue is solved?

@aaronbannin
Copy link
Author

If anyone tries a simple pip install, it will still fail, right? Perhaps a version bump would provide stability? If 1.4.1a1 got promoted to 1.5.0?

@araffin
Copy link
Member

araffin commented Feb 23, 2022

If anyone tries a simple pip install, it will still fail, right?

Only on Mac OS with your setup when using the [extra] argument (where something goes wrong at compile time apparently).

erhaps a version bump would provide stability? If 1.4.1a1 got promoted to 1.5.0?

I would like to wait a bit before doing a new release, mostly to catch potential bugs and check full compatibility with the newest gym version (#780 requires additional work).
In the meantime, one can always install from source or use the alpha version on pypi.

@olenmg
Copy link

olenmg commented Feb 25, 2022

If anyone tries a simple pip install, it will still fail, right? Perhaps a version bump would provide stability? If 1.4.1a1 got promoted to 1.5.0?

Hello. I'm not sure if the stable-baselines3 fully supports M1 mac, but I also failed with pip install and succeed with 1.4.1a1 on my m1 pro mac.

@araffin
Copy link
Member

araffin commented 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 ;)

@araffin araffin added mac os and removed bug Something isn't working labels Feb 25, 2022
@aaronbannin
Copy link
Author

@araffin I'm on an Intel chip. I think the core problem might be the PyPi artifact has a dependency graph that points to a version of atari-py that was removed from PyPi.

@araffin araffin mentioned this issue Mar 25, 2022
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants