sconiac
sconiac

Reputation: 593

Error while installing pytq5 with pip: 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.

Any ideas ??

Upvotes: 55

Views: 285670

Answers (11)

Jacob S&#225;nchez
Jacob S&#225;nchez

Reputation: 459

I faced this issue with pyqt5==5.15.1 and solved it by upgrading to pyqt5==5.15.9

Upvotes: 0

multigoodverse
multigoodverse

Reputation: 8072

An easier solution that worked for me on an M1 Mac.

  1. Download Python 3.7.7 from here and install it. https://www.python.org/downloads/macos/

  2. Install pyqt5 with:

    pip3.7 install pyqt5

  3. Execute your code using Python 3.7.

Upvotes: 0

Samnit Sandhu
Samnit Sandhu

Reputation: 11

You just have uninstall python 3.10 from Program and Features in Control panel and then install python 3.9 from microsoft office for free

Upvotes: 0

Michal Grabka
Michal Grabka

Reputation: 1

Got this on Raspberry / Debian 10 (buster) with Python 3.7.3

This solved problem for me:

python3 -m pip install qt5-default

Upvotes: 0

Mohammad Al Jadallah
Mohammad Al Jadallah

Reputation: 486

Ok, I faced this issue with python 3.10.4 and after searching I found two solutions for this problem because this problem not being only with turtle but for other libraries.

#Note: These solutions for downloading any library if you have a problem mentioned above and this faced me in windows.

So you could try this way:

pip install turtle==0.0.1

0.0.1 This is the last version of the library so you should find the version of the library that you want to install for this purpose, you can find the version of the library using this command:

pip show module <name_of_the_library>

another solution that could work is using --use-deprecated=backtrack-on-build-failures

Example:

pip install turtle --use-deprecated=backtrack-on-build-failures

Hope to help you.

Upvotes: 6

Preminster
Preminster

Reputation: 495

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).

Upvotes: 35

Wanmiao Zhang
Wanmiao Zhang

Reputation: 11

I met the same problem and then I reinstall the python3.9, it`s fixed after.

Upvotes: 1

Digres
Digres

Reputation: 84

I was getting similar error. Below steps worked for me

  1. Uninstall python
  2. Download newer version or other version for python and install
  3. python -m pip install PyQt5

It should fix this error.

Upvotes: 0

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

Upvotes: 1

valilai
valilai

Reputation: 141

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

Upvotes: 14

Ploni5
Ploni5

Reputation: 31

Like @Ken1124 i tackeled the same issue when trying to download the tools (aka pyqt5-tools). After many tries I found it helpful to downgrade python to version 3.9.x (specifically to 3.9.9) from 3.10.x. If you currently have python 3.10 it might help, but otherwise idk...

Other methods that I tried which I didn't see to fix the issue, but perhaps fixed other problem assosicated with the issue as well:

  • Changing from Microsoft Store version of python to the site's verstion.
  • using only pyqt5 (I first had both 5 & 6).
  • Downgrading pip (right after upgrading).

That's all I know, wish you good luck :)

Upvotes: 3

Related Questions