The Error “AttributeError: module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel'”, is an error that is invoked when you are working on python and are trying to install the pytq5 library using pip install.
Given below is the snippet of the error you might get:
AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
I would like to share with you the steps I took to fix the “AttributeError: module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel’.”
Why “AttributeError module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel'” Error is Seen?
The error, “AttributeError: module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel'” is seen because, you might be missing the qmake in your path if you trying to install Qt5.
If you read the PyPi download site for Qt5 installation, you will find the “Installation chapter” which clearly states that you need “Qt’s qmake tool on PATH” to install Qt5 correctly.
The GPL version of PyQt5 can be installed from PyPI: pip install PyQt5 pip will also build and install the bindings from the sdist package but Qt’s qmake tool must be on PATH. The sip-install tool will also install the bindings from the sdist package but will allow you to configure many aspects of the installation. Source: Python Installation Guide
Qt is a group of cross-platform C++ libraries that provide high-level APIs for interacting with many parts of current desktop and mobile systems. Location and positioning services, multimedia, NFC and Bluetooth connection, a Chromium-based web browser, and classic UI development are among them.
PyQt5 is a large collection of Python bindings for Qt v5. It is built as more than 35 extension modules and allows Python to be used as a replacement for C++ as an application development language on all supported platforms, including iOS and Android.
PyQt5 may also be incorporated in C++-based programs to enable users to adjust or improve the functionality of such apps.
The detailed solution to fix the error “AttributeError: module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel'”, is given below:
How to fix “AttributeError module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel'” Error?
To fix the error, for Mac OS users: you will have to make sure that you install Qt5 in your operating system. Once Qt5 installed in your system, then you will have to make its qmake
in PATH
.
For windows, the normal installation steps provided by the pypi’s official website should work and fix the AttributeError: module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel’ error.
To fix the error, “AttributeError: module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel'”, you will have to follow one to the methods mentioned below depending on your operating system:
Mac OS Installation:
If you are using a Mac os and and facing this error then first you will have to make sure that you install Qt5 in your operating system. Once Qt5 installed in your system, then you will have to make its qmake
in PATH
.
The first step would be to Run brew install qt5 or download the installer from the website, mentioned here, to install Qt5.
It should be noted that in order to complete the installation if you decide to utilize the installer, you will need to sign in or create a qt.io account.
You can download previous installers from the URL provided here if you use an earlier version of MacOS.
Here you can see which version is compatible with your operating system. You can then change qt-5.14 in the url the version you want to use.

Find qmake’s location after installation. Usually your should find the location in the following path, /Users/Admin/Qt5.14.2/5.14.2/clang 64/bin, but this changes from system to system. This must be included in the PATH environment variable.
You will have to Edit you .bash profile in your home folder to do this , you might need to use Command + Shift +. to see dotfiles in Finder first, and then add the below mentioned code to it:
export PATH="$PATH:/Users/Admin/Qt5.14.2/5.14.2/clang_64/bin"
Now, you ought to be able to type qmake and see its help text generated when you open a new terminal. PyQt5 installation must now be successful, given the Qt5 version you installed supports your MacOS version.
This should fix the error “AttributeError: module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel'”.
Window Installation:
For window installation you can simply follow the installation steps provided by the pypi official website. The normal installation should work correctly for windows.
You can download PyQt5’s GPL version from PyPI by running the command mentioned below:
pip install PyQt5
Although Qt’s qmake tool has to be on PATH, pip will also create and install the bindings from the sdist package.
Besides letting you customize many installation-related elements, the sip-install utility will also install the bindings from the sdist package.
This should fix the error “AttributeError: module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel'”.
Conclusion
To fix the error “AttributeError: module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel'”, for mac os first, you will have to make sure that you install Qt5 in your operating system.
Once Qt5 installed in your system, then you will have to make its qmake
in PATH
. For windows the normal installation steps provided by the pypi’s official website should work