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

Problem with google colab #1406

Closed
chukalexander opened this issue Mar 23, 2023 · 6 comments · Fixed by #1327
Closed

Problem with google colab #1406

chukalexander opened this issue Mar 23, 2023 · 6 comments · Fixed by #1327
Labels
colab Related to Google Colab Notebooks openai gym related to OpenAI Gym interface

Comments

@chukalexander
Copy link

There seems to be a problem installing the package to google colab, which was still working as of 21st-Mar-2023
Please advise

image

@araffin
Copy link
Member

araffin commented Mar 23, 2023

Hello,
I think the colab still runs afterward, no?
The issue seems to be related to gym, probably related to #1324 and openai/gym#3176 (comment)

Should be solved by #1327

@chukalexander
Copy link
Author

The the module is not installed in the above case, and colab will not run.

#1327 solves the problem, thank you

@araffin araffin added colab Related to Google Colab Notebooks openai gym related to OpenAI Gym interface labels Mar 23, 2023
@araffin araffin mentioned this issue Mar 23, 2023
20 tasks
@JY251
Copy link

JY251 commented Mar 23, 2023

I found this issue is caused by SB3 using gym version 0.21.0. When I tried to install this version using !pip install gym==0.21.0 on Google Colab, it didn't work.
I then attempted to install other versions, such as the latest version and version 0.22.0, and was succeeded in doing so with pip install.
There seems to be some code within the SB3 library that specifies the gym version, so I addressed this issue by changing them not to specify the gym version and was able to install SB3 by !pip install git+https://github.com/JY251/stable-baselines3.git.

This is my forked and modified repository of SB3:
JY251/stable-baselines3.

@araffin
Copy link
Member

araffin commented Mar 24, 2023

There seems to be some code within the SB3 library that specifies the gym version

yes, SB3 pins gym version as later version have some breaking changes.

If you want to use latest gym version or gymnasium, please take a look at #1327.

The the module is not installed in the above case, and colab will not run.

When I try to reproduce the error, setuptools fallback to legacy install and I can import the correct gym version afterward.

Doing install in verbose mode !pip install gym==0.21 -vvv show the real error:

 Traceback (most recent call last):
    File "/usr/local/lib/python3.9/dist-packages/wheel/vendored/packaging/requirements.py", line 35, in __init__
      parsed = parse_requirement(requirement_string)
    File "/usr/local/lib/python3.9/dist-packages/wheel/vendored/packaging/_parser.py", line 64, in parse_requirement
      return _parse_requirement(Tokenizer(source, rules=DEFAULT_RULES))
    File "/usr/local/lib/python3.9/dist-packages/wheel/vendored/packaging/_parser.py", line 82, in _parse_requirement
      url, specifier, marker = _parse_requirement_details(tokenizer)
    File "/usr/local/lib/python3.9/dist-packages/wheel/vendored/packaging/_parser.py", line 126, in _parse_requirement_details
      marker = _parse_requirement_marker(
    File "/usr/local/lib/python3.9/dist-packages/wheel/vendored/packaging/_parser.py", line 147, in _parse_requirement_marker
      tokenizer.raise_syntax_error(
    File "/usr/local/lib/python3.9/dist-packages/wheel/vendored/packaging/_tokenizer.py", line 163, in raise_syntax_error
      raise ParserSyntaxError(
  wheel.vendored.packaging._tokenizer.ParserSyntaxError: Expected end or semicolon (after version specifier)
      opencv-python>=3.

@JiXiang-Zhou
Copy link

When I tried to install imitation package, I got the same error. How to fix that

@araffin
Copy link
Member

araffin commented Mar 29, 2023

When I tried to install imitation package, I got the same error. How to fix that

Please read #1406 (comment)
See openai/gym#3200 for a solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
colab Related to Google Colab Notebooks openai gym related to OpenAI Gym interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants