We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose-cells Python via Java Workbook _init__() takes exactly one argument

We are encountering an Exception loading an existing XLSX file into a Workbook. We are following the guidance on this page Different Ways to Open Files|Documentation (aspose.com)](https://docs.aspose.com/cells/python-java/different-ways-to-open-files/#opening-a-file-via-a-stream)
from java_client import java_client # starting java, not relevant for this question
from jpype import java
import jpype
import asposecells
from asposecells.api import *
fis = java.io.FileInputStream(“template.xlsx”) # Error raised - below
logging.info(“file read”)
workbook = Workbook(fis)

Exception: TypeError: object.init() takes exactly one argument (the instance to initialize)

line 47, in test_function workbook = Workbook(fis) File “/home/site/wwwroot/.python_packages/lib/site-packages/asposecells/api.py”, line 2992, in init super(Workbook, self).init(*args)

Platform: Debian
Python 3.9


Which version of the API (Aspose.Cells for Python via Java) you are using? Also, provide complete environment details. Does the issue occur only with specific Excel file or for all Excel files?


  • aspose-cells-20.2.0
  • install-jdk-0.3.0
  • jpype1-1.4.1
  • packaging-23.0


workbook = Workbook(fis) File “/home/site/wwwroot/.python_packages/lib/site-packages/asposecells/api.py”, line 2992, in init super(Workbook, self).init(*args)

Would you like to test again with Aspose-cells Python via Java 23.1? We can get the right result. The following is the test code, please check.

import jpype
from jpype import java
import asposecells
from asposecells.api import Workbook, SaveFormat
fis = java.io.FileInputStream(“template_simple.xlsx”)
workbook = Workbook(fis)

I think the exception may have something to do with the java_client you use. Aspose.Cells for Python via Java only supports Jdk1.8 or higher, please refer to https://docs.aspose.com/cells/python-java/getting-started/#installation