How to fix issue with QtPdf in Conda environment?

1 week ago 3
ARTICLE AD BOX

I needed to use python occ so I installed anaconda and now I'm not sure why QtPdf is not working while everything else seems to be fine. I haven't used anaconda before.

Steps:

conda create -n xxxx python=3.10.19 conda activate xxxx conda install -c conda-forge pythonocc-core conda install -c conda-forge pyside6 conda install -c conda-forge pandas conda install -c conda-forge openpyxl

After that I opened my vs studio with code . and checked if right interpreter is in use and ran my script.

It states:

Traceback (most recent call last): File "PATH", line 1, in <module> from PySide6.QtPdf import QPdfDocument ModuleNotFoundError: No module named 'PySide6.QtPdf'

This is minimal reproducible example:

from PySide6.QtPdf import QPdfDocument print("Imported!")

This is just an example script as the issue is the same. When I'm in conda env it's not detecting QtPdf, but if I swap to non conda env it works just fine.

Info:

Pyside6 - 6.8.3
qt6-main 6.8.3
PythonOCC - 7.9.0
Openpyxl - 3.1.5
Pandas - 2.3.3
Python - 3.10.19
conda 25.5.1
OS: win11

Read Entire Article