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

与Python 3.12不兼容,报错“No module named 'distutils'” #58

Closed
RuikangSun opened this issue Jul 17, 2024 · 2 comments
Closed

Comments

@RuikangSun
Copy link
Contributor

运行“start_windows.bat”时报错:

Traceback (most recent call last):
  File "114514\GPT4V-Image-Captioner\gpt-caption.py", line 19, in <module>
    from lib.Detecter import detecter
  File "114514\GPT4V-Image-Captioner\lib\Detecter.py", line 2, in <module>
    import GPUtil
  File "114514\GPT4V-Image-Captioner\myenv\Lib\site-packages\GPUtil\__init__.py", line 33, in <module>
    from .GPUtil import GPU, getGPUs, getAvailable, getAvailability, getFirstAvailable, showUtilization, __version__
  File "114514\GPT4V-Image-Captioner\myenv\Lib\site-packages\GPUtil\GPUtil.py", line 34, in <module>
    from distutils import spawn
ModuleNotFoundError: No module named 'distutils'

检索可知Python3.12已经移除了“distutils”模块,而该模块是由程序使用的GPUtil引用,但GPUtil社区已经不再活跃,近五年没有更新。

是否有必要删除相关代码,以使程序支持最新版的Python 3.12?

@RuikangSun
Copy link
Contributor Author

创建了一个魔改自GPUtil的库:https://pypi.org/project/graphicstatus/
这个改动使得Python3.12正常运行,但我项目管理经验不是很足,需要我提交PR把GPUtil替换吗?

RuikangSun added a commit to RuikangSun/GPT4V-Image-Captioner that referenced this issue Jul 18, 2024
@SleeeepyZhou
Copy link
Collaborator

Thx!!! 🎉🫡
非常感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants