lukas-blecher / LaTeX-OCR

pix2tex: Using a ViT to convert images of equations into LaTeX code.
https://lukas-blecher.github.io/LaTeX-OCR/
MIT License
12.01k stars 984 forks source link

latexocr: DLL load failed while importing QtCore #330

Open MartinNiederl opened 10 months ago

MartinNiederl commented 10 months ago

I created a new conda env using:

conda create --name latex_ocr python=3.10
conda activate latex_ocr
conda install pytorch pytorch-cuda=11.8 -c pytorch -c nvidia
pip install "pix2tex[gui]"

Getting error:

(latex_ocr) > C:\Users\marti>latexocr
Traceback (most recent call last):
  File "D:\ProgramData\condaenvs\latex_ocr\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\ProgramData\condaenvs\latex_ocr\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\ProgramData\condaenvs\latex_ocr\Scripts\latexocr.exe\__main__.py", line 7, in <module>
  File "D:\ProgramData\condaenvs\latex_ocr\lib\site-packages\pix2tex\__main__.py", line 25, in main
    from .gui import main
  File "D:\ProgramData\condaenvs\latex_ocr\lib\site-packages\pix2tex\gui.py", line 21, in <module>
    import pix2tex.resources.resources
  File "D:\ProgramData\condaenvs\latex_ocr\lib\site-packages\pix2tex\resources\resources.py", line 6, in <module>
    from PySide6 import QtCore
ImportError: DLL load failed while importing QtCore: The specified procedure could not be found.

Also tried installing versions 6.5.1 and 6.5.2 of PyQt based on this https://github.com/lukas-blecher/LaTeX-OCR/issues/257#issuecomment-1651686937 but the error message is still the same.

Pedsurgeon1 commented 10 months ago

HI @MartinNiederl I had the same problem and I solved it as follows

I removed all packages that have different versions and installed only versions 6.5.1 for them all

you can do so by implementing these codes

pip uninstall -y PyQt6 PyQt6-Qt6 PyQt6-sip PyQt6-WebEngine PyQt6-WebEngine-Qt6

pip uninstall -y PySide6 PySide6-Addons PySide6-Essential shiboken6

pip install PyQt6==6.5.1 PyQt6-Qt6==6.5.1 PyQt6-WebEngine-Qt6==6.5.1 PyQt6-WebEngine

pip install PySide6-Essentials==6.5.1 PySide6==6.5.1 PySide6-Addons==6.5.1 shiboken6==6.5.1

after that install the latest version as recommended by the author

pip install "git+https://github.com/lukas-blecher/LaTeX-OCR.git#egg=pix2tex[gui]"

It works for me now

abenezerGithub commented 10 months ago

thank you dude it also works for me thankyou

duolanda commented 10 months ago

HI @MartinNiederl I had the same problem and I solved it as follows

I removed all packages that have different versions and installed only versions 6.5.1 for them all

you can do so by implementing these codes

pip uninstall -y PyQt6 PyQt6-Qt6 PyQt6-sip PyQt6-WebEngine PyQt6-WebEngine-Qt6

pip uninstall -y PySide6 PySide6-Addons PySide6-Essential shiboken6

pip install PyQt6==6.5.1 PyQt6-Qt6==6.5.1 PyQt6-WebEngine-Qt6==6.5.1 PyQt6-WebEngine

pip install PySide6-Essentials==6.5.1 PySide6==6.5.1 PySide6-Addons==6.5.1 shiboken6==6.5.1

after that install the latest version as recommended by the author

pip install "git+https://github.com/lukas-blecher/LaTeX-OCR.git#egg=pix2tex[gui]"

It works for me now

It works! Thank you very much!