[Bug] ModuleNotFoundError: No module named 'resource'
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
Start in task_queue.py at the import resource and the get_memory_mb function shown in the issue. Run uvx agent-task-queue@latest on Windows to reproduce the ModuleNotFoundError, then verify the command starts successfully and reports process memory without the import failure.
Written by the indexing model from the issue text.
Description
Describe the bug
Encountered error while attempting to run agent-task-queue
To Reproduce:
Steps to reproduce the behavior:
- Run command $uvx agent-task-queue@latest$
- Encountered error
Traceback (most recent call last):
File "<frozen runpy>", line 203, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\sheld\AppData\Local\uv\cache\archive-v0\d0WBs-76xzVqcxx1\Scripts\agent-task-queue.exe\__main__.py", line 4, in <module>
from task_queue import main
File "C:\Users\sheld\AppData\Local\uv\cache\archive-v0\d0WBs-76xzVqcxx1\Lib\site-packages\task_queue.py", line 12, in <module>
import resource
ModuleNotFoundError: No module named 'resource'
Environment (please complete the following information):
- OS: Windows 11
Additional Notes
import resource is Linux\MacOS specific.
For cross-compatibility, we could use
import os
import psutil
then change
def get_memory_mb() -> float:
"""Get current process memory usage in MB (RSS - resident set size)."""
usage = resource.getrusage(resource.RUSAGE_SELF)
# ru_maxrss is in bytes on Linux, kilobytes on macOS
if os.uname().sysname == "Darwin":
return usage.ru_maxrss / (1024 * 1024) # KB to MB
return usage.ru_maxrss / 1024 # bytes to MB on Linux
to
def get_memory_mb() -> float:
"""Get current process memory usage in MB (RSS - resident set size)."""
return psutil.Process(os.getpid()).memory_info().rss / (1024 ** 2)
- Dominant language
- Python
- Stars
- 68
- Forks
- 7
- Avg merge
- 51m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from block/agent-task-queue
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
block/agent-task-queue#34 · 1 comment ·
-
Dependency Dashboard Open
block/agent-task-queue#1 · 1 assignee ·
All issues in block/agent-task-queue
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100