ImportError: cannot import name 'arabicocr' from partially initialized module 'ArabicOcr' (most likely due to a circular import)

ImportError: cannot import name 'arabicocr' from partially initialized module 'ArabicOcr' (most likely due to a circular import)

我正在尝试使此代码正常工作

from ArabicOcr import arabicocr

这个错误不断出现在我面前

ImportError: cannot import name 'arabicocr' from partially initialized module 'ArabicOcr' (most likely due to a circular import) (D:\aaaa\ExpsLpKeras\Exps\ArabicOcr.py)

这是循环导入,您是从 ArabicOcr 导入 arabicocr,但在 ArabicOcr 中,您是从文件中导入某些内容。

如果你的文件是B,而A​​rabicOcrA:

  • B 你有来自 A 导入一个
  • 然后在 A 你有来自 B 导入 b

所以无法导入,因为两个文件相互依赖。