#4000 ModuleNotFoundError: No module named 'torch._strobelight'

128.1* Posted at: 2 hours ago 👁5

Traceback (most recent call last):
File "C:\Users\anhtu\Desktop\PyvideoTrans\pyvideotrans\videotrans\util\checkgpu.py", line 14, in run

_count = gpus.getset_gpu()
         ^^^^^^^^^^^^^^^^^

File "C:\Users\anhtu\Desktop\PyvideoTrans\pyvideotrans\videotrans\util\gpus.py", line 20, in getset_gpu

import torch

File "C:\Users\anhtu\Desktop\PyvideoTrans.venv\Lib\site-packages\torch\__init__.py", line 53, in

from torch._utils_internal import (

File "C:\Users\anhtu\Desktop\PyvideoTrans.venv\Lib\site-packages\torch\_utils_internal.py", line 11, in

from torch._strobelight.compile_time_profiler import StrobelightCompileTimeProfiler

ModuleNotFoundError: No module named 'torch._strobelight'


=
system:Windows-10-10.0.26200-SP0
version:v3.98
frozen:False
language:vi
root_dir:C:/Users/anhtu/Desktop/PyvideoTrans/pyvideotrans
Python: 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)]

1 Replies

这是由于 PyTorch 库文件损坏或安装不完整导致的。

解决方案:

  1. 进入软件根目录下的 .venv\Lib\site-packages\ 文件夹。
  2. 删除名为 torchtorch-* 的文件夹(例如 torch-2.4.0.dist-info)。
  3. 重新运行 uv sync 命令来重新安装依赖包,或者直接使用 uv add torch 命令重新安装 PyTorch。

请查阅相关文档:

  • Linux 源码部署(虽然针对Linux,但其中关于 uv sync 重新安装依赖的步骤是通用的)
Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Related resource