jiayev / GPT4V-Image-Captioner

GNU General Public License v3.0
787 stars 58 forks source link

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

Open RuikangSun opened 3 months ago

RuikangSun commented 3 months ago

运行“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 commented 3 months ago

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