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

[Ray 1.8] "ray memory" fails with "No module named 'aiohttp.signals'" #20681

Closed
1 of 2 tasks
metalcycling opened this issue Nov 23, 2021 · 6 comments
Closed
1 of 2 tasks
Labels
bug Something that is supposed to be working; but isn't P0 Issues that should be fixed in short order

Comments

@metalcycling
Copy link

metalcycling commented Nov 23, 2021

Search before asking

  • I searched the issues and found no similar issues.

Ray Component

Ray Core

What happened + What you expected to happen

Hi Ray team,

I can run most ray commands like ray status and ray timeline but when I try ray memory I get the following error:

Traceback (most recent call last):
  File "/home/metalcycling/.local/bin/ray", line 8, in <module>
    sys.exit(main())
  File "/home/metalcycling/.local/lib/python3.8/site-packages/ray/scripts/scripts.py", line 1969, in main
    return cli()
 ...
  File "/home/metalcycling/.local/lib/python3.8/site-packages/ray/dashboard/optional_deps.py", line 8, in <module>
    import aiohttp.signals
ModuleNotFoundError: No module named 'aiohttp.signals'

I manually imported the code on my Python shell and while import aiohttp works, import aiohttp.signals doesn't work. On the aio-libs page somebody reported the same issue here, so this is a problem on their side, really. But it seems they are not following their own deprecation process and that means the signals module is not available. Is there a way to fix Ray so I can use the memory utility?

Thanks,
Pedro

Versions / Dependencies

metalcycling@linux:~$ python3 --version
Python 3.8.8
>>> import aiohttp
>>> aiohttp.__version__
'3.8.1'
>>> 
>>> import ray
>>> ray.__version__
'1.8.0'
>>>

Reproduction script

metalcycling@linux:~$ ray memory

Anything else

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!
@metalcycling metalcycling added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Nov 23, 2021
@TheFizzWare
Copy link

TheFizzWare commented Nov 24, 2021

Also having this issue but for doing

ray.init(include_dashboard=True)

which eventually trips this raise ImportError(... on line 1204 of ray's services.py

1199:        # Make sure the process can start.
1200:        try:
1201:            import ray.dashboard.optional_deps  # noqa: F401
1202:        except ImportError:
1203:            if require_dashboard:
1204:                raise ImportError(DASHBOARD_DEPENDENCY_ERROR_MESSAGE)
1205:            else:
1206:                return None, None

... Meanwhile, doing pip install -U 'ray[default]' only results in Requirement already satisfied: ....

The reason I know it's the aiohttp.signals line is because running the import line in a fresh python shell of the same environment gives:

>>> import ray.dashboard.optional_deps  # noqa: F401
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/austin/anaconda3/envs/moto/lib/python3.9/site-packages/ray/dashboard/optional_deps.py", line 8, in <module>
    import aiohttp.signals
ModuleNotFoundError: No module named 'aiohttp.signals'
>>> 

Same version of ray and aiohttp as @metalcycling, but in Python 3.9.7.

@TheFizzWare
Copy link

It appears that the issue also involves any

import aiohttp.frozenlist

That was discovered by commenting out the import aiohttp.signals line from ray's optional_deps.py, trying the import again, and getting the same ModuleNotFoundError for aiohttp.frozenlist instead of aiohttp.signals.

I was able to ray.dashboard.optional_deps after commenting those two import lines in optional_deps.py, and have moved on to debugging other issues in starting the dashboard. I'm not yet sure that commenting out those dependencies is enough to bypass the issue for now.

@pcmoritz
Copy link
Contributor

pcmoritz commented Nov 24, 2021

This is a known problem that is fixed in the Ray master in #20261.

In the current Ray release you can pin aiohttp by running pip install aiohttp==3.7 which will fix it.

@ericl ericl added P0 Issues that should be fixed in short order and removed triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Nov 24, 2021
@ericl ericl changed the title "ray memory" fails with "No module named 'aiohttp.signals'"[Bug] [Ray 1.8] "ray memory" fails with "No module named 'aiohttp.signals'" Nov 24, 2021
@TheFizzWare
Copy link

@pcmoritz Thank you, worked exactly as you said it did.

@scv119
Copy link
Contributor

scv119 commented Nov 30, 2021

@ericl looks this is fixed?

@scv119 scv119 closed this as completed Nov 30, 2021
@2726651506
Copy link

pip install aiohttp==3.7.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't P0 Issues that should be fixed in short order
Projects
None yet
Development

No branches or pull requests

6 participants