Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux系统报错TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' #18

Open
HI406 opened this issue Jul 10, 2024 · 4 comments

Comments

@HI406
Copy link

HI406 commented Jul 10, 2024

运行Demo文件就报错了
刚开始是报错缺字体,我在/usr/share/fonts目录下创建了myfonts文件夹,复制进去simsun.ttc、COURI.TTF和STKAITI.TTF三个字体后,再运行就报这个错误:
:~$ python3 '/home/gxxc/Downloads/demo.py'

/home/easyofd
/home
Traceback (most recent call last):
  File "/home/gxxc/Downloads/demo.py", line 20, in <module>
    from easyofd.ofd import OFD
  File "/home/gxxc/.local/lib/python3.9/site-packages/easyofd/__init__.py", line 1, in <module>
    from .ofd import OFD
  File "/home/gxxc/.local/lib/python3.9/site-packages/easyofd/ofd.py", line 22, in <module>
    from easyofd.draw import DrawPDF,OFDWrite
  File "/home/gxxc/.local/lib/python3.9/site-packages/easyofd/draw/__init__.py", line 14, in <module>
    from .draw_ofd import OFDWrite
  File "/home/gxxc/.local/lib/python3.9/site-packages/easyofd/draw/draw_ofd.py", line 21, in <module>
    class OFDWrite(object):
  File "/home/gxxc/.local/lib/python3.9/site-packages/easyofd/draw/draw_ofd.py", line 53, in OFDWrite
    def build_document_res(self, img_len: int = 0, id_obj: CurId = None, pfd_res_uuid_map: [dict|None]=None):
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
@renoyuan
Copy link
Owner

Linux 新增字体后我记得好像是要加载一下的,有操作吗?
文件提供一下?我本地试试看看

@HI406
Copy link
Author

HI406 commented Jul 11, 2024

没有操作,是在运行demo时import就报错了,不过我大概懂是什么原因了。
我上面的报错是在python 3.9.19下出现的,换成python 2.7.16就正常运行了,easyofd是不支持python3吗?

@renoyuan
Copy link
Owner

emmm, easyofd 目前开发环境是支持到3.11.5 的。python2 没试过应该是不支持的把。

@HI406
Copy link
Author

HI406 commented Jul 11, 2024

谢谢,更新python版本到3.11.5就可以运行了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants