Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

1

36.8K
Views
Error installing pytq5: Preparing metadata (pyproject.toml) did not run successfully

I try to install pytq5 with pip and get this error

$ python3 -m pip install PyQt5
Collecting PyQt5
  Using cached PyQt5-5.15.6.tar.gz (3.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [29 lines of output]
      Traceback (most recent call last):
        File "/Users/olivierskonieczny/Desktop/app/python/ObjectDetection/envs/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, in prepare_metadata_for_build_wheel
          hook = backend.prepare_metadata_for_build_wheel
      AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/Users/olivierskonieczny/Desktop/app/python/ObjectDetection/envs/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        ...
        ...
        ...
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I still can install other packages like lxml but can't install pytq5. I'm installing everything in virtual environment.

over 4 years ago · Santiago Trujillo
9 answers
Answer question

0

I faced the same problem these days. When you have a look at PyPi download site, you can read in the Installation chapter that you need "Qt's qmake tool on PATH". After installing Qt's development files everything worked fine for me. So first install it and make sure it's on your PATH and than try again.

sudo apt-get install qtbase5-dev
pip install pyqt5

PS: I think it has nothing to do with your python or pip version. I tried many versions and had this problem every time. It's just missing, corrupted or not found header development files from qt5.

Regards, Vali

over 4 years ago · Santiago Trujillo Report

0

over 2 years ago · Minerva Katherine Ramos Suarez Report

0

This error usually occurs due to an incompatibility between the versions of PyQt5 , sip , pip and/or the version of Python you are using in the virtual environment.

The key clue is this line:

 AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'

This indicates that during compilation, PyQt5 is attempting to use an unsupported version of sip .

1. Check the versions

Within your virtual environment, run:

 python --version
pip --version

and:

 pip list | grep -E "pip|setuptools|wheel|sip"

2. Update the build tools

Often it can be solved with:

 python -m pip install --upgrade pip setuptools wheel

Then try again:

 python -m pip install PyQt5

3. Update or reinstall SIP

If the problem persists:

 python -m pip uninstall sip
python -m pip install --upgrade sip

and then:

 python -m pip install PyQt5

4. Force the installation of a recent version

If you are using Python 3.9, try:

 python -m pip install PyQt5==5.15.11

or simply:

 python -m pip install --only-binary=:all: PyQt5

This forces the use of a precompiled wheel instead of compiling from source code.

5. If you are on macOS with Apple Silicon (M1/M2/M3)

Check the architecture:

 uname -m

If it returns:

 arm64

Make sure you have a recent version of pip:

 python -m pip install --upgrade pip

Older versions of pip sometimes fail to find the correct wheels for PyQt5 and end up trying to compile it, which generates errors like the one you show.

6. Check that you haven't misspelled the name

Your question states:

 pytq5

But the correct package is:

 pip install PyQt5

(with Qt , not tq ).

If it still fails after this, share the output of:

 python --version
pip --version
pip show sip
pip show PyQt5

and the last 20–30 complete lines of the traceback to identify exactly which combination of versions is causing the conflict.

3 months ago · Ruben Alexander Serrano Porras Report

1

MacOS-specific answer

You need to have Qt5 installed in the system, and you need to have its qmake in PATH.

To install Qt5, you can either run brew install qt5 or download the installer from https://www.qt.io/download-qt-installer.

Note that if you choose to use the installer, it will require you to log in to or create a qt.io account to perform the installation.

If you have an older version of MacOS, you can download older installers from https://download.qt.io/archive/qt/. You can check which version supports your OS version in https://doc.qt.io/archives/qt-5.14/supported-platforms.html, where you can swap out qt-5.14 in the url for whichever version you are interested in.

After the installation, find where qmake is located. For me using the installer for 5.14.2 it was in /Users/Admin/Qt5.14.2/5.14.2/clang_64/bin. You need to add this to the PATH environment variable. To do so edit .bash_profile in your home folder (may need to press Command + Shift + . first to see dotfiles in Finder) and add to it something the following:

export PATH="$PATH:/Users/Admin/Qt5.14.2/5.14.2/clang_64/bin"

Now, upon launching a new terminal, you should be able to type qmake and see its help text be outputted. Installing PyQt5 should now succeed (provided the Qt5 version you installed supports your MacOS version).

over 4 years ago · Santiago Trujillo Report

1

Install and uninstall

almost 4 years ago · Oscar Caicedo Report

1

If you are encountering an error while installing pyqt5 with pip, it is likely that there is a problem with the installation process. Some common reasons for this error include:

  1. The pyqt5 package is not available on PyPI, the Python Package Index. This can happen if the package has been removed, or if it has never been uploaded to PyPI. In this case, you will need to install pyqt5 from a different source, such as the official PyQt5 website or a third-party package repository.

  2. There is a problem with your pip installation. This can happen if pip is not installed correctly, or if it is outdated. In this case, you may need to upgrade pip or reinstall it to fix the problem.

  3. There is a problem with your Python installation. This can happen if Python is not installed correctly, or if it is an older version that is not compatible with pyqt5. In this case, you may need to upgrade or reinstall Python to fix the problem.

If you continue to encounter problems while installing pyqt5, it is recommended that you seek assistance from the pyqt5 community or from a qualified Python developer. They will be able to provide further guidance and help you troubleshoot the issue.

over 3 years ago · Juan Pablo Isaza Report

1

I got the same error and fixed it by simply uninstalling 3.10 and installing 3.9. x2

over 2 years ago · brandon alexander mendieta suarez Report

1

This could be caused by an incompatibility in the version of PyQt5 that is being released and the version of Python that you have in your virtual environment.

Study

Sorry for the difficulty you are experiencing installing PyQt5 touch. There seems to be a problem with the generation of package metadata.

This could be caused by an incompatibility in the version of PyQt5 that is being released and the version of Python that you have in your virtual environment.

To resolve this issue, I would recommend you try the following:

  1. Make sure you have the latest version of pip-almazación. You can run the following command in your terminal:

     python3 -m pip install --upgrade pip
    

    Try PyQt5 using the --no-cache-dir option for cache issues. Run the following command:

     python3 -m pip install --no-cache-dir PyQt5
    

    If that's the problem, you can try specifying a specific version of PyQt5 that is compatible with the version of Python you have in your virtual environment. For example, if you are using Python 3.9, you can install all PyQt5 version 5.15.4 following the command:

     python3 -m pip install --no-cache-dir PyQt5==5.15.4
    

Hoping that these steps help you solve the problem and that PyQt5 can be installed successfully

over 2 years ago · Minerva Katherine Ramos Suarez Report

-1

I got that same error and I fixed it just by uninstalling 3.10 and installing 3.9.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!