Tableau最近将一些开发人员的工具从Windows扩展到Linux。在Linux(64Bit,版本8.1)上下载Python(2.7)的Tableau Data Extract API库后,我使用标准的'python setup.py install'解压缩文件并安装库
尝试使用适用于Windows的代码运行时,出现以下错误:
Traceback (most recent call last):
File "apache.py", line 280, in <module>
print create_tableau(tsvfile)
File "apache.py", line 136, in create_tableau
import dataextract as tde
File "/usr/local/lib/python2.7/dist-packages/dataextract/__init__.py", line 15, in <module>
from Base import *
File "/usr/local/lib/python2.7/dist-packages/dataextract/Base.py", line 17, in <module>
from . import StringUtils
File "/usr/local/lib/python2.7/dist-packages/dataextract/StringUtils.py", line 17, in <module>
tablib = libs.load_lib
File "/usr/local/lib/python2.7/dist-packages/dataextract/Libs.py", line 35, in load_lib
self.lib = ctypes.cdll.LoadLibrary(self.lib_path)
File "/usr/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /usr/local/lib/python2.7/dist-packages/dataextract/lib/../lib/libicuio.so.50: file too short
如何修复此'文件太短'错误?
答案 0 :(得分:1)
复制或提取库时出错,其中链接实际上是文件。类似的例子是here。
您需要删除应该是链接的文件,然后重新链接它们。
cd /usr/local/lib/python2.7/dist-packages/dataextract/lib/../lib/
rm libicudata.so.50 && ln -s libicudata.so.50.1.2 libicudata.so.50
rm libicui18n.so.50 && ln -s libicui18n.so.50.1.2 libicui18n.so.50
rm libicuio.so.50 && ln -s libicuio.so.50.1.2 libicuio.so.50
rm libicule.so.50 && ln -s libicule.so.50.1.2 libicule.so.50
rm libiculx.so.50 && ln -s libiculx.so.50.1.2 libiculx.so.50
rm libicutu.so.50 && ln -s libicutu.so.50.1.2 libicutu.so.50
rm libicuuc.so.50 && ln -s libicuuc.so.50.1.2 libicuuc.so.50