我正在尝试使用 sutime python 包装器来制作日期规范化器,它将字符串中的任何时间信息转换为格式为 YYYY-MM-DD 的日期。我创建了一个类,其中包含 sutime 输出的规则,以将 sutime 输出转换为上述标准格式。该程序在我的本地计算机上正常运行,但是当我尝试在服务器上运行它时,我得到 jpype._jclass.NoClassDefFoundError。服务器在带有 python2 的 ubuntu 上,而我的本地有 windows,带有 python3。
我已尝试在此https://sourceforge.net/p/jpype/discussion/379372/thread/689d7a9b/论坛上实现类似问题的解决方案,但我不确定我是否能够实现这些灵魂正确。我还检查了 sutime 是否支持 python3 和 python2
我认为问题出在 jpype 或 sutime 库上。
This is the traceback that i got
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "date_normalizer.py", line 38, in __init__
self.sutime = SUTime(jars=self.jar_files, mark_time_ranges=mark_time_ranges)
File "/home/bridgei2i/.local/lib/python2.7/site-packages/sutime/sutime.py", line 57, in __init__
'edu.stanford.nlp.python.SUTimeWrapper')
File "/home/bridgei2i/.local/lib/python2.7/site-packages/jpype/_jclass.py", line 130, in __new__
return _JClassNew(args[0], **kwargs)
File "/home/bridgei2i/.local/lib/python2.7/site-packages/jpype/_jclass.py", line 213, in _JClassNew
javaClass = _jpype.PyJPClass(arg)
jpype._jclass.NoClassDefFoundError: edu/stanford/nlp/python/SUTimeWrapper