Skip to content

Conversation

@Flink-ddd
Copy link
Contributor

@Flink-ddd Flink-ddd commented Jul 15, 2025

This PR resolves an issue where the ImportError message for pyspiel in rllib/env/utils/__init__.py (line 37-39) contained a typo and inconsistent information.

Specifically, it changes:

  • "Pygame is not a dependency of RLlib" to "Pyspiel is not a dependency of RLlib"
  • "pip install pygame" to "pip install pyspiel"

This ensures that users receive accurate guidance for installing the correct dependency (pyspiel) when the import fails.

Closes #53841


Note

Fixes the try_import_pyspiel ImportError message to reference pyspiel and suggest installing open_spiel.

  • rllib/env/utils/init.py:
    • Update try_import_pyspiel ImportError text to correctly reference pyspiel and guide installation via pip install open_spiel.

Written by Cursor Bugbot for commit 119e42e. This will update automatically on new commits. Configure here.

@Flink-ddd Flink-ddd requested a review from a team as a code owner July 15, 2025 06:23
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @Flink-ddd, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a minor but important issue by correcting an erroneous import error message. The change ensures that users receive accurate guidance for installing the correct dependency when a specific module fails to import, thereby improving the overall developer experience and reducing potential confusion.

Highlights

  • Error Message Correction: Corrected a typo and inconsistency within the ImportError message for the pyspiel module. The message previously incorrectly referred to 'Pygame' instead of 'pyspiel'.
  • Improved User Guidance: Updated the suggested installation command provided in the ImportError message from pip install pygame to pip install pyspiel, ensuring users receive accurate instructions for resolving the missing dependency.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes a typo in an error message for the optional pyspiel dependency, improving clarity for users. My review includes a suggestion to further refine the error message to be more explicit about pyspiel being an optional dependency, which would make it even more helpful.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Thanks for fixing this typo! The change is correct.

For even better clarity, I suggest rephrasing the error message to avoid the potentially confusing statement that pyspiel is "not a dependency". While it's not a core dependency, it is required for certain features, making it an optional dependency.

This alternative wording is more direct and clearly communicates the nature of the dependency to the user.

A similar message exists for open_spiel in this file, which could also benefit from this clarification for consistency.

Suggested change
"Could not import pyspiel! pyspiel is not a dependency of RLlib "
"and RLlib requires you to install pyspiel separately: "
"`pip install pyspiel`."
"Could not import pyspiel! pyspiel is an optional dependency of RLlib "
"and must be installed separately. You can install it with: "
"`pip install pyspiel`."

@Flink-ddd Flink-ddd force-pushed the fix/rllib-typo-53841 branch 2 times, most recently from 8663107 to a25c718 Compare July 15, 2025 06:40
@cszhu cszhu added community-contribution Contributed by the community rllib RLlib related issues labels Jul 15, 2025
@Flink-ddd Flink-ddd force-pushed the fix/rllib-typo-53841 branch from a25c718 to e3c3f94 Compare July 15, 2025 12:45
@Flink-ddd
Copy link
Contributor Author

Hi @cszhu , I noticed that buildkite/microcheck keeps failing for this PR (build #20431 etc). My change was just a small typo fix for the pyspiel import error message (from pygame to pyspiel), is this related to general instability in CI or inherent instability in these specific tests themselves? Any insight or manual rerun and I would be greatly appreciated. Thanks!

@cszhu
Copy link
Collaborator

cszhu commented Jul 16, 2025

Hello @Flink-ddd , thanks for opening a PR to help contribute to Ray :) I took a peek at the microcheck, I think it's likely not due to the changes in your CR since you just edited an error message... Unless the tests are checking specifically for that error message.
We can wait for an official ✅ from the RLlib team before moving forward. I will take a closer look if it keeps failing tomorrow as well.

@Flink-ddd Flink-ddd force-pushed the fix/rllib-typo-53841 branch from 28f0fbb to 5b57803 Compare July 17, 2025 10:13
@Flink-ddd Flink-ddd force-pushed the fix/rllib-typo-53841 branch from 5b57803 to 546ba63 Compare July 17, 2025 10:14
@Flink-ddd
Copy link
Contributor Author

Hi @cszhu , Thank you very much to reply me, buildkite/microcheck already passed, but the buildkite/premerge wait a long time, what's question is it?

@cszhu
Copy link
Collaborator

cszhu commented Jul 21, 2025

Hi, the buildkite/premerge will automatically start after the PR has been reviewed by a team member. So don't worry about it for now! :)

@Flink-ddd
Copy link
Contributor Author

Hi, I see, Thank you very much for you reply.

@github-actions
Copy link

github-actions bot commented Aug 6, 2025

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Aug 6, 2025
@github-actions github-actions bot added unstale A PR that has been marked unstale. It will not get marked stale again if this label is on it. and removed stale The issue is stale. It will be closed within 7 days unless there are further conversation labels Aug 6, 2025
@pseudo-rnd-thoughts
Copy link
Member

I've checked through the tests and can't see any would cause an issue from fixing this error message.
Looks good to run the tests and merge @cszhu

@cszhu
Copy link
Collaborator

cszhu commented Sep 30, 2025

Thank you! I don't have merge perms but I will let the team know and get back to you 🫡

@pseudo-rnd-thoughts pseudo-rnd-thoughts added the go add ONLY when ready to merge, run all tests label Sep 30, 2025
@pseudo-rnd-thoughts pseudo-rnd-thoughts self-assigned this Sep 30, 2025
@Flink-ddd
Copy link
Contributor Author

Hi @pseudo-rnd-thoughts , Thank for your approval, btw about this PR what time can be merge to master?

@pseudo-rnd-thoughts
Copy link
Member

pseudo-rnd-thoughts commented Oct 31, 2025

@Flink-ddd I don't have permissions to merge but will get someone who can

@Flink-ddd
Copy link
Contributor Author

Hi @pseudo-rnd-thoughts , Thanks for your help and for finding someone to merge this! Thanks again!

@simonsays1980 simonsays1980 merged commit 1d57f9a into ray-project:master Nov 7, 2025
6 checks passed
Aydin-ab pushed a commit to Aydin-ab/ray-aydin that referenced this pull request Nov 19, 2025
ykdojo pushed a commit to ykdojo/ray that referenced this pull request Nov 27, 2025
@Flink-ddd Flink-ddd changed the title fix(rllib): Correct typo and consistency in pyspiel import error message (#53841) [Bugfix][rllib]: Correct typo and consistency in pyspiel import error message (#53841) Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community go add ONLY when ready to merge, run all tests rllib RLlib related issues unstale A PR that has been marked unstale. It will not get marked stale again if this label is on it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RLlib] Typo in error message on line 37 of ray/rllib/env/utils/__init__.py

4 participants