简体   繁体   中英

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

I am trying to make this code work

from ArabicOcr import arabicocr

and this error keeps pop to me

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

It's a circular import, you are importing arabicocr from ArabicOcr, but there in ArabicOcr you are importing something from your file.

If your file is B , and ArabicOcr is A :

  • in B you have from A import a
  • then in A you have from B import b

So importation can not be achieved because both files are dependent one to other.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM