Solving 'Project ERROR: Unknown module(s) in QT: webkitwidgets' in Amazon Linux AMI QT5.6 Installation

Hello data scientists and software engineers

Solving “Project ERROR: Unknown module(s) in QT: webkitwidgets” in Amazon Linux AMI QT5.6 Installation

Hello data scientists and software engineers! Today, we tackle a common issue encountered when installing QT5.6 on Amazon Linux AMI: the infamous “Project ERROR: Unknown module(s) in QT: webkitwidgets”. By the end of this post, you’ll have a solid grasp on what causes this error and how to resolve it.

Understanding the Error

Before we delve into the solution, let’s understand the problem. The error “Project ERROR: Unknown module(s) in QT: webkitwidgets” usually arises when you are attempting to compile a project that requires the QtWebKitWidgets module, but it isn’t present in your QT5.6 installation.

QtWebKit is a web content rendering engine based on the WebKit open-source project. It was deprecated in QT5.5 and removed entirely from QT5.6. That’s the root cause of the error - we’re trying to access a module that doesn’t exist in the version we’re using.

Solution Approach

There are two primary ways to solve this issue:

  1. Downgrade to an earlier version of QT that includes the QtWebKitWidgets module.
  2. Manually install QtWebKit in your QT5.6 environment.

While the first option is feasible, it could be problematic if you need features exclusive to QT5.6. Therefore, we’ll focus on the second route: manual installation.

Step-by-step Guide to Manually Installing QtWebKit

Here’s the step-by-step guide to install QtWebKit on Amazon Linux AMI for QT5.6:

  1. Prepare Your System:

    Update your system and install the necessary dependencies:

    sudo yum update -y
    sudo yum groupinstall "Development Tools" -y
    sudo yum install libXtst-devel -y
    
  2. Download and Unpack QtWebKit:

    QtWebKit is not included in the official QT5.6 distribution, but it is still maintained by the community. You can download it from the community repository:

    wget https://github.com/qtwebkit/qtwebkit/releases/download/qtwebkit-5.212.0-alpha4/qtwebkit-5.212.0-alpha4.tar.xz
    tar xf qtwebkit-5.212.0-alpha4.tar.xz
    
  3. Compile and Install QtWebKit:

    Navigate to the source directory and run qmake and make to compile QtWebKit:

    cd qtwebkit-5.212.0-alpha4
    qmake
    make
    sudo make install
    

    This process can take a while, as QtWebKit is a large module.

  4. Confirm the Installation:

    After the installation, confirm that QtWebKit is available:

    qmake -query QT_INSTALL_PREFIX
    

    You should see /usr/local/Qt-5.6.3 or something similar, depending on your QT version.

And voilà! You’ve successfully installed QtWebKit on your Amazon Linux AMI running QT5.6.

Conclusion

“The Project ERROR: Unknown module(s) in QT: webkitwidgets” is a common issue that arises when using the newer versions of QT. By following the steps outlined in this guide, you can manually install the QtWebKit module and resolve this error. This process is not only a fix but also a learning opportunity about how modules in QT5.6 work.

Remember, understanding the cause of an error is half the battle in resolving it. Happy coding!

Keywords: Amazon Linux AMI, QT5.6 Installation, Project ERROR: Unknown module(s) in QT: webkitwidgets, Manual Installation, QtWebKit


If you found this article helpful, please share it with your colleagues. For more how-to guides and solutions to common technical issues, stay tuned to our blog!


About Saturn Cloud

Saturn Cloud is your all-in-one solution for data science & ML development, deployment, and data pipelines in the cloud. Spin up a notebook with 4TB of RAM, add a GPU, connect to a distributed cluster of workers, and more. Join today and get 150 hours of free compute per month.