[Bug] ModuleNotFoundError: No module named 'resource'
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
Hướng nghiên cứu
Bắt đầu trong task_queue.py, tại phần import resource và hàm get_memory_mb được nêu trong issue. Chạy uvx agent-task-queue@latest trên Windows để tái hiện ModuleNotFoundError, sau đó xác minh rằng lệnh khởi động thành công và báo cáo bộ nhớ của tiến trình mà không gặp lỗi import.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)
- Ngôn ngữ chính
- Python
- Star
- 68
- Fork
- 7
- Merge trung bình
- 51 phút
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của block/agent-task-queue
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
block/agent-task-queue#34 · 1 bình luận ·
-
Dependency Dashboard Đang mở
block/agent-task-queue#1 · 1 người được giao ·
Tất cả issue của block/agent-task-queue
Issue tương tự
-
triage/confirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
NousResearch/hermes-agent#118866 ·
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
apache/cloudstack#14222 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100