Aspose Linux Runtime Error

Hello,

After using Aspose.words for python on net in Windows, I was tasked with running it in Linux. After pip installing it for the venv and rechecking the requirements on https://docs.aspose.com/words/python-net/system-requirements/#system-requirements-for-target-linux-and-macos-platforms, I am still getting a runtime error on the import line for aspose words. The error is “terminate called after throwing an instance of ‘std::runtime_error’
what(): DynamicLibrary::load”. What could be causing that?

@nober

It sounds like you’re encountering a runtime error when trying to use Aspose.Words for Python on Linux. The error message “terminate called after throwing an instance of ‘std::runtime_error’ what(): DynamicLibrary::load” typically indicates that there might be an issue with loading the required dynamic libraries.

Cause: This error often arises from missing or incompatible dynamic libraries that Aspose.Words depends on.

Solution: Here are some steps you can take to troubleshoot and resolve this issue:

  1. Check System Requirements: Ensure that your Linux environment meets all the system requirements specified for Aspose.Words, including having the necessary libraries and dependencies installed.

  2. Install Required Libraries: Make sure that you have installed all the required libraries. For example, you may need to install libglib2.0-0, libgstreamer1.0-0, and other dependencies that Aspose.Words relies on.

  3. Verify Python Environment: Ensure that you are using the correct Python virtual environment where Aspose.Words is installed. You can activate your virtual environment and check the installed packages with pip list.

  4. Check for Missing Libraries: Use a tool like ldd to check if there are any missing shared libraries for the Aspose.Words library. You can run ldd <path_to_aspose_words_library> to see if all dependencies are resolved.

  5. Reinstall Aspose.Words: If the above steps do not resolve the issue, try uninstalling and then reinstalling the Aspose.Words package in your virtual environment:

    pip uninstall aspose-words
    pip install aspose-words
    
  6. Consult Logs: If the error persists, check any logs or additional error messages that might provide more context about what is failing.

Next Steps: Please follow these steps and let me know if they help resolve the issue. If you continue to experience problems, provide any additional error messages or logs, and I will assist you further.

Thank you for your patience, and I look forward to your update!

@nober Could you please describe your environment and provide full error message here for our reference? We will check the problem on our side and provide you more information.
The following file can be useful for you:
https://github.com/aspose-words/Aspose.Words-for-Python-via-.NET/blob/master/Dockerfile

So we are using python 3.11.7 for the python version and the linux server is on red hat 9. I did not get another error message outside of what I posted in the original post.

Using the LDD command, we downloaded any of dependencies that were missing. The last run of the LDD command did not list any ones missing. We are still getting the same error. I am using we because, while I can run the python code, someone else at the company handles the linux installs.

@nober Could you please provide you input document and code that will allow us to reproduce the problem? We will check your scenario on our side and provide you more information.

I am not sure I am allowed to post that. Right now that error is thrown on the import aspose.words as aw line.

@nober Usually such problems occur when some dependency is missed. I will consult with our developers from Python team and get back to you soon.

Meanwhile, please try installing OpenSSL 1.1:
https://docs.resolve.io/pro/Standard%20Installation%20and%20Upgrade/installing-openssl-on-rhel/

@nober Working Linux configurations are currently only those that are published in the Dockerfile on GitHub. Tests in the current state do not pass on red hat. This is not possible for now since ubi9 only supports Openssl3.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSPYTHON-57

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.