OleehyO / TexTeller

TexTeller can convert image to latex formulas (image2latex, latex OCR) with higher accuracy and exhibits superior generalization ability, enabling it to cover most usage scenarios.
Apache License 2.0
309 stars 32 forks source link

ImportError: attempted relative import with no known parent package #63

Closed ALIOSKUPER closed 3 months ago

ALIOSKUPER commented 3 months ago

使用pycharm,在对分词器或者texteller训练的时候就会出现这个错误,但是在脚本import模块组件那通过ctrl+左键可以直接进入到对应的模型,以及可以进入对应的函数或类。 希望能得到您的帮助

OleehyO commented 3 months ago

因为使用了相对导入,所以需要在src/目录下运行脚本,并使用-m选项。

ALIOSKUPER commented 3 months ago

您说的那样是可以的!!! 为了在pycharm中进行调试,我参考了这个链接 改成可以在pycharm进行同样效果的运行https://blog.csdn.net/qq_39852676/article/details/107856620, ![Uploading image.png…]()
非常感谢您的帮助!!!