aspose-words / Aspose.Words-for-Python-via-.NET

Aspose.Words for Python via .NET examples and showcases
MIT License
109 stars 23 forks source link

centos7.9 err #5

Closed zhongsdjn closed 2 years ago

zhongsdjn commented 2 years ago

import aspose.words as aw

certHolder = aw.digitalsignatures.CertificateHolder.create("morzal.pfx", "aw") aw.digitalsignatures.DigitalSignatureUtil.sign("t1.docx", "t2.docx", certHolder)

on windows that's ok! but does not on CentOS : [root@i-jidipjl1 sign_docx]# python3 test.py Traceback (most recent call last): File "test.py", line 1, in import aspose.words as aw File "/usr/local/python3/lib/python3.7/site-packages/aspose/init.py", line 44, in load_module native_module = self._load_native_module(native_name) File "/usr/local/python3/lib/python3.7/site-packages/aspose/init.py", line 76, in _load_native_module return _load(spec) ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory

on other server docker env,it's :verify error。。。 why?

alex-dudin commented 2 years ago

There are additional requirements for the target Linux platform: https://docs.aspose.com/words/python-net/system-requirements/#system-requirements-for-target-linux-platform

List of additional requirements for the CentOS 7.9 and Python 3.7: 1) libpython3.7m shared library. Python 3.7 must be compiled with --enable-shared build option (disabled by default) and --with-pymalloc build option (enabled by default). For example:

sudo yum install gcc openssl-devel bzip2-devel libffi-devel
wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz
tar xvf Python-3.7.12.tgz
cd Python-3.7.12
./configure --enable-optimizations --enable-shared
make altinstall

2) ICU package. ICU can be installed with yum:

sudo yum install icu

3) GCC-6.5 runtime libraries (or later). The following steps illustrate how to install GCC 6.5.0 on CentOS 7.9:

sudo yum install gcc gcc-c++ libmpc-devel mpfr-devel gmp-devel zlib-devel
wget https://ftp.gnu.org/gnu/gcc/gcc-6.5.0/gcc-6.5.0.tar.gz
tar xvf gcc-6.5.0.tar.gz
cd gcc-6.5.0
./configure --with-system-zlib --disable-multilib --enable-languages=c,c++
make install

One other common issue is that libpython3.7m.so and libstdc++.so.6.0 libraries are installed in a different location than the standard system location for shared libraries. The issue can be fixed by creating a symbolic links to the libraries in the system standard location for shared libraries. Also, you can set the LD_LIBRARY_PATH environment variable in the current shell before running python3.7:

export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/local/lib64