Aspose.words/aspose.slides conflict

I am trying to work with both aspose-slides and aspose-words. However, I’m finding if I pip install aspose-words first, then I get a conflict trying to import aspose-words (but not aspose-slides).

Python 3.12.5 (tags/v3.12.5:ff3bc82, Aug 6 2024, 20:45:27) [MSC v.1940 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
import aspose.words as aw

ImportError: Unable to import module dependencies. Cannot import the aspose.pyreflection module. The aspose.pyreflection module found has a version (‘24.5.3.0’) that is lower than the referenced version of that module (‘25.8.0.0’).
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “”, line 1, in
ImportError: One or more errors occurred while loading the module ‘aspose.words’ (-1009)

import aspose.slides as slides
Note, no error here

Then If I pip install aspose-slides first, I get an issue with importing aspose.slides, but not aspose.words:

Python 3.12.5 (tags/v3.12.5:ff3bc82, Aug 6 2024, 20:45:27) [MSC v.1940 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
import aspose.slides as slides

AttributeError: module ‘aspose.pydrawing’ has no attribute ‘_C_APITV1_SizeF’
The above exception was the direct cause of the following exception:
ImportError: can’t import capsule ‘aspose.pydrawing._C_APITV1_SizeF’
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “”, line 1, in
ImportError: One or more errors occurred while loading the module ‘aspose.slides’ (-1009)

import aspose.words as aw
Note, no error here

I am unsure what to do about this. I am currently using Python 3.12.5 as the above text copied from my interpreter shows. I can’t find any documentation about a conflict like this. Here’s what pip list shows for aspose packages I have installed:

aspose-cells 25.9.0
aspose_slides 25.9.0
aspose-words 25.10.0

I am also trying to use aspose-cells, but that seems to be okay as long as I install it last (in both of the above cases). Granted, I have not begun evaluating it’s use otherwise.

@seanwhitsitt

It appears you are facing version conflicts between the Aspose libraries while attempting to import them in Python. The error messages suggest that there are mismatched versions of the aspose.pyreflection module, leading to these import issues.

Here are some steps to help you resolve this:

  1. Check Compatibility: Verify that the versions of aspose-words, aspose-slides, and any other Aspose libraries you are using are compatible with each other. Refer to the official documentation or release notes for compatibility details.

  2. Upgrade/Downgrade Packages: Consider upgrading or downgrading the packages to ensure they are all on compatible versions. You can use the following command to upgrade:

    pip install --upgrade aspose-words aspose-slides
    

    Alternatively, specify a version if necessary:

    pip install aspose-words==25.9.0 aspose-slides==25.9.0
    
  3. Install Order: The order of installation can impact imports. Try installing aspose-words and aspose-slides in different sequences to determine if one order resolves the issue.

  4. Virtual Environment: Utilize a virtual environment to isolate your project dependencies. This approach can help prevent conflicts with other installed packages.

  5. Check for Updates: Ensure you are using the latest versions of the libraries, as newer releases may resolve existing issues.

If the problem persists, consider reaching out to the Aspose support forums for more tailored assistance regarding your specific issue.

  1. I am unable to find compatibility notes for the releases. I probably just don’t know where to look, but I’ve done some poking around and Googling and have yet to find them. I will continue to look.
  2. I have similar issues if I use aspose.words 25.9.0 instead of 25.10.0. Perhaps I need to downgrade further? Until I can resolve #1 I don’t know that I’m served well by blindly guessing.
  3. My initial query describes how I changed install order.
  4. I don’t know how different virtual environments will help when I need to combine docx and pptx processing into the same product, unless you’re suggesting I run two separate file processors in two separate environments, and use system calls to hook them together. That seems a bit cumbersome for a paid product like Aspose, I’m going to assume that there’s a better solution for now.
  5. As far as I can tell from using pip --upgrade these are the latest released versions.

Further investigation shows an error when trying pip install aspose-total-net as well (granted this provides more than I was looking for to begin with, so the ideal would still be to simply install aspose-words, aspose-slides, and aspose-cells-python):

Collecting aspose-total-net
  Downloading aspose_total_net-25.9.0-py3-none-any.whl.metadata (15 kB)
INFO: pip is looking at multiple versions of aspose-total-net to determine which version is compatible with other requirements. This could take a while.
  Downloading aspose_total_net-25.7.0-py3-none-any.whl.metadata (16 kB)
  Downloading aspose_total_net-25.6.0-py3-none-any.whl.metadata (16 kB)
  Downloading aspose_total_net-25.5.0-py3-none-any.whl.metadata (16 kB)
  Downloading aspose_total_net-25.4.0-py3-none-any.whl.metadata (16 kB)
  Downloading aspose_total_net-25.3.0-py3-none-any.whl.metadata (16 kB)
  Downloading aspose_total_net-25.2.0-py3-none-any.whl.metadata (16 kB)
  Downloading aspose_total_net-25.1.0-py3-none-any.whl.metadata (16 kB)
INFO: pip is still looking at multiple versions of aspose-total-net to determine which version is compatible with other requirements. This could take a while.
  Downloading aspose_total_net-24.12.0-py3-none-any.whl.metadata (16 kB)
  Downloading aspose_total_net-24.11.0-py3-none-any.whl.metadata (16 kB)
  Downloading aspose_total_net-24.10.0-py3-none-any.whl.metadata (16 kB)
  Downloading aspose_total_net-24.9.0-py3-none-any.whl.metadata (16 kB)
  Downloading aspose_total_net-24.8.0-py3-none-any.whl.metadata (16 kB)
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
  Downloading aspose_total_net-24.7.0-py3-none-any.whl.metadata (16 kB)
  Downloading aspose_total_net-24.6.0-py3-none-any.whl.metadata (15 kB)
  Downloading aspose_total_net-24.5.0-py3-none-any.whl.metadata (15 kB)
  Downloading aspose_total_net-24.4.0-py3-none-any.whl.metadata (14 kB)
  Downloading aspose_total_net-24.3.0-py3-none-any.whl.metadata (14 kB)
  Downloading aspose_total_net-24.2.0-py3-none-any.whl.metadata (14 kB)
  Downloading aspose_total_net-24.1.0-py3-none-any.whl.metadata (13 kB)
  Downloading aspose_total_net-23.12.0-py3-none-any.whl.metadata (13 kB)
  Downloading aspose_total_net-23.11.0-py3-none-any.whl.metadata (13 kB)
  Downloading aspose_total_net-23.10.0-py3-none-any.whl.metadata (13 kB)
  Downloading aspose_total_net-23.9.0-py3-none-any.whl.metadata (12 kB)
  Downloading aspose_total_net-23.8.0-py3-none-any.whl.metadata (11 kB)
  Downloading aspose_total_net-23.7.0-py3-none-any.whl.metadata (11 kB)
  Downloading aspose-total-net-22.6.0.tar.gz (4.2 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "c:\users\sean_ohxx9v1\appdata\local\programs\python\python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>
          main()
        File "c:\users\sean_ohxx9v1\appdata\local\programs\python\python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "c:\users\sean_ohxx9v1\appdata\local\programs\python\python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\sean_ohxx9v1\AppData\Local\Temp\pip-build-env-_11yasda\overlay\Lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\sean_ohxx9v1\AppData\Local\Temp\pip-build-env-_11yasda\overlay\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires
          self.run_setup()
        File "C:\Users\sean_ohxx9v1\AppData\Local\Temp\pip-build-env-_11yasda\overlay\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup
          super().run_setup(setup_script=setup_script)
        File "C:\Users\sean_ohxx9v1\AppData\Local\Temp\pip-build-env-_11yasda\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup
          exec(code, locals())
        File "<string>", line 4, in <module>
      FileNotFoundError: [Errno 2] No such file or directory: 'README.md'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.