我尝试使用https://www.csie.ntu.edu.tw/~cjlin/libshorttext/处的libshorttext库构建Docker容器。该库是用C ++编写的,因此在运行Makefile时,将生成一些.so文件。但是,当我尝试从Docker容器运行Python脚本时,却不断出现此错误:
Traceback (most recent call last):
File "train.py", line 6, in <module>
from libshorttext.classifier import *
File "/opt/program/libshorttext/classifier/__init__.py", line 37, in <module>
from .classifier_impl import *
File "/opt/program/libshorttext/classifier/classifier_impl.py", line 8, in <module>
from ..converter import *
File "/opt/program/libshorttext/converter/__init__.py", line 15, in <module>
from .converter_impl import *
File "/opt/program/libshorttext/converter/converter_impl.py", line 21, in <module>
from .stemmer import porter
File "/opt/program/libshorttext/converter/stemmer/porter.py", line 8, in <module>
stemmer = CDLL(os.path.join(os.path.dirname(__file__),'./porter.so.1'))
File "/usr/lib/python2.7/ctypes/__init__.py", line 362, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /opt/program/libshorttext/converter/stemmer/./porter.so.1:
invalid ELF header
这些脚本仍然可以在本地计算机上正常运行。有人知道如何解决这个问题吗?