JVMNotFoundException reported while using Aspose.Cells for Python via Java

Good afternoon! I can’t understand the reason for the error in my code: ’
JVMNotFoundException: No JVM shared library file (libjli.dylib) found. Try setting up the JAVA_HOME environment variable properly.’

import jpype

import asposecells

jpype.startJVM()

from asposecells.api import *

# Load Excel file

workbook = Workbook("Акт_МПурга_без допэкономии_'+ str(actual_month).lower() +'.xlsm")

# Create and set PDF options

# pdfOptions = PdfSaveOptions()

# pdfOptions.setCompliance(PdfCompliance.PDF_A_1_B)

# # Convert Excel to PDF

# workbook.save("xlsx-to-pdf.pdf", pdfOptions)

# Convert Excel to PDF

workbook.save("xlsx-to-pdf.pdf", SaveFormat.PDF)

@riarden
Please do some checks and tests on your environment to help us to locate the issue.versions:

  1. check your OS, java, and python versions.

  2. check if JAVA_HOME is set.
    echo $JAVA_HOME

  3. Test JPype1 with the following code:
    import jpype

import jpype.imports

from jpype.types import *

jpype.startJVM()

from java.util import ArrayList

myList = ArrayList()

myList.add(1)

myList.add(2)

print(‘length:’, len(myList))

jpype.shutdownJVM()

Good afternoon! OS Sierra v.10.13.6, Python 3.10.6, JAVA_HOME not installed

@riarden
Jdk needs to be installed, otherwise it will not work.

Good afternoon! The code works . Thanks! The only unpleasant thing is the inscription
‘Evaluation Only. Created with Aspose.Cells for Python via Java.Copyright 2003 - 2022 Aspose Pty Ltd.’
Need to buy the paid version?

1 Like

@riarden,

Yes the evaluation watermark would be always added if you don’t use a valid license and set it in code at the start before processing any other code. You may purchase the license or request for a free 30 days temporary license.

1 Like