PyQt5 import failure when running OpenLP-2.9.2 in PyCharm

Thanks to @JohnM and after hours of work, I have now install PyCharm and I am running the OpenLP-2.9.2 successfully for debugging on my windows 10 platform.

When I Run, Debug the OpenLP-2.9.2 it runs to "threading.py" and fails at "from PyQt5 import QtCore.

Under View, Tools Window, Python Packages I can see all the Installed package (and there is a bunch) and PyQt5 5.15.4 is installed.

I'm guessing that I may not have the correct versions of something installed:

I have Python 3.7.9 installed, PyCharm 2021.1 (Community Edition) Build #PC-211.6693.115 and running OpenLP project extracted from OpenLP-29.9.2-1.tar.gz

Can anyone help?

@JohnnyFowler

Comments

  • edited April 17

    I did a manual CMD line check_dependencies.py and found

    C:\Users\Johnny\Desktop\OpenLP_Development\OpenLP-2.9.2\scripts>python check_dependencies.py

    Checking Python version...

     Python >= 3.6 ...                   3.7.9.final.0

    Checking for modules...

     PyQt5 ...                           OK

     PyQt5.QtCore ...                    FAIL

     PyQt5.QtGui ...                     FAIL

     PyQt5.QtWidgets ...                 FAIL

     PyQt5.QtNetwork ...                 FAIL

     PyQt5.QtOpenGL ...                  FAIL

     PyQt5.QtSvg ...                     FAIL

     PyQt5.QtTest ...                    FAIL

     PyQt5.QtWebEngineWidgets ...        FAIL

     PyQt5.QtMultimedia ...              FAIL

     appdirs ...                         OK

     sqlalchemy ...                      OK

     alembic ...                         OK

     lxml ...                            OK

     chardet ...                         OK

     flask ...                           OK

     flask_cors ...                      OK

     bs4 ...                             OK

     mako ...                            OK

     websockets ...                      OK

     waitress ...                        OK

     webob ...                           OK

     requests ...                        OK

     qtawesome ...                       ERROR

     pymediainfo ...                     OK

     vlc ...                             ERROR

     zeroconf ...                        OK

    Checking for optional modules...

     qdarkstyle (dark style support)...  OK

     pymysql (MySQL support)...          OK

     pyodbc (ODBC support)...            OK

     psycopg2 (PostgreSQL support)...    OK

     enchant (spell checker)...          ERROR

     fitz (PyMuPDF - PDF support)...     OK

     pysword (import SWORD bibles)...    OK

     uno (LibreOffice/OpenOffice support)... FAIL

     jenkins (access jenkins api)...     OK

     pytest (testing framework)...       OK

     pytestqt (testing framework)...     OK

     flake8 (linter)...                  FAIL

    Then I did "pip install sqlalchemy alembic appdirs chardet beautifulsoup4 lxml Mako pymysql pytest pyodbc psycopg2 pypiwin32 websockets asyncio waitress six webob requests pyopengl qtAwesome PyQt5 pymediainfo pywin32 pysword PyQtWebEngine python-vlc pymupdf pyenchant pylint python-jenkins launchpadlib qdarkstyle pyro4 zeroconf flask flask_cors pytest-qt"

    But got the same "ERROR" and "FAIL" on the items above.

    Help!

  • edited April 17

     File "C:\Users\Johnny\Desktop\OpenLP_Development\OpenLP-2.9.2\openlp\core\threading.py", line 24, in <module>

       from PyQt5 import QtCore

    ImportError: DLL load failed: The specified module could not be found.

    Searching I've found many fixes for this known error, but nothing I've tried works including adding into to my Path environmental variable.

  • Do I need to purchase a commercial license for PyQt5 to get its modules to work?

    Reference: https://www.riverbankcomputing.com/static/Docs/PyQt5/introduction.html

  • edited April 18

    WOW! Do I have to spent $550 and year to license PyQt5 before I can get PyCharm to work for OpenLP?

    https://riverbankcomputing.com/commercial/buy

  • edited April 19

    No, you do not need to buy PyQt, that is only for the commercial version.

    As you can see, you actually already have the base PyQt5 package: `PyQt5 ...                           OK`

    I think most of those other packages are supposed to come with the PyQt5, you could try reinstall it? Also make sure pip is installing into the same python environment that you are running OpenLP in. (and on some systems, pip for python 3 is pip3)

    If the check_dependencies.py script shows fails or out of date versions, OpenLP will not function properly.


    You do not need to purchase anything, this is a dependency issue.

  • @Johnny Fowler Inside your environment, try the `pip list` command. It should give you a little bit of information on what is actually installed in your environment. And to add to ninjakiwi, try installing the libraries one at a time. Yes it is supposed to be able to load them in a long list, but sometime loading one at a time will give you hints to what isn't happening!

  • You might want to look at the wiki: https://gitlab.com/openlp/wiki/-/wikis/Development/Windows_Development_Environment

    It has this list of packages, although I'm not sure how up to date it is

    pip install sqlalchemy alembic appdirs chardet beautifulsoup4 lxml Mako pymysql pytest pyodbc psycopg2 pypiwin32 websockets asyncio waitress six webob requests pyopengl qtAwesome PyQt5 pymediainfo pywin32 pysword PyQtWebEngine python-vlc pymupdf pyenchant pylint python jenkins launchpadlib qdarkstyle pyro4 zeroconf flask flask_cors pytest-qt
    
Sign In or Register to comment.