Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyQt5-tools fails to install #106

Closed
abulgher opened this issue Jun 30, 2022 · 8 comments
Closed

PyQt5-tools fails to install #106

abulgher opened this issue Jun 30, 2022 · 8 comments

Comments

@abulgher
Copy link

I'm trying to install pyqt5-tools (just for the designer) on a fresh python virtual environment on Window.
But I get the following error message from pip:

  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 "c:\Users\Antonio\testenv\lib\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 "c:\Users\Antonio\testenv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
          main()
        File "c:\Users\Antonio\testenv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "c:\Users\Antonio\testenv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 160, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
        File "C:\Users\Antonio\AppData\Local\Temp\pip-build-env-i8iu0fc8\overlay\Lib\site-packages\sipbuild\api.py", line 46, in build_wheel
          project = AbstractProject.bootstrap('wheel',
        File "C:\Users\Antonio\AppData\Local\Temp\pip-build-env-i8iu0fc8\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 87, in bootstrap
          project.setup(pyproject, tool, tool_description)
        File "C:\Users\Antonio\AppData\Local\Temp\pip-build-env-i8iu0fc8\overlay\Lib\site-packages\sipbuild\project.py", line 584, in setup
          self.apply_user_defaults(tool)
        File "C:\Users\Antonio\AppData\Local\Temp\pip-install-hyvt3yny\pyqt5_eb0ef21f6fd44feab5540f177959c190\project.py", line 63, in apply_user_defaults
          super().apply_user_defaults(tool)
        File "C:\Users\Antonio\AppData\Local\Temp\pip-build-env-i8iu0fc8\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
          super().apply_user_defaults(tool)
        File "C:\Users\Antonio\AppData\Local\Temp\pip-build-env-i8iu0fc8\overlay\Lib\site-packages\sipbuild\project.py", line 236, in apply_user_defaults
          self.builder.apply_user_defaults(tool)
        File "C:\Users\Antonio\AppData\Local\Temp\pip-build-env-i8iu0fc8\overlay\Lib\site-packages\pyqtbuild\builder.py", line 67, in apply_user_defaults
          raise PyProjectOptionException('qmake',
      sipbuild.pyproject.PyProjectOptionException
      [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.

Do you have an idea on how to solve this issue?

@abulgher
Copy link
Author

abulgher commented Jul 1, 2022

I have tried to download and install from local the wheel file. I got the following error message:

(simpleenv) c:\Users\Antonio\Documents\pyenv\simpleenv>pip install "c:\Users\Antonio\Downloads\pyqt5_tools-5.15.4.3.2-py3-none-any.whl"
Processing c:\users\antonio\downloads\pyqt5_tools-5.15.4.3.2-py3-none-any.whl
Collecting python-dotenv
  Using cached python_dotenv-0.20.0-py3-none-any.whl (17 kB)
ERROR: Could not find a version that satisfies the requirement pyqt5-plugins<5.15.4.3,>=5.15.4.2.2 (from pyqt5-tools) (from versions: none)
ERROR: No matching distribution found for pyqt5-plugins<5.15.4.3,>=5.15.4.2.2

Due to this error pip it is trying to build from source and then failing.

I think that this issue is a duplicate of #100

@Breiz-sk
Copy link

Did you solve this ?

@abulgher
Copy link
Author

Yes, following the suggestion of issue #100

@megaromb
Copy link

The workaround suggested by Andrew Ushakov worked for me
I subscribed to this thread to get notified about the fix

@KhanSuleimenov
Copy link

I also had this error install version 3.9
Or any other version before 3.10

@kaminaryuu
Copy link

kaminaryuu commented Feb 7, 2023

I tried to do what Andrew wrote on #100, but I still couldn't install it.

@altendky
Copy link
Owner

Hey all, this is a common note I'm adding to several issues.

I apologize for the hassle you have all dealt with around this project. I don't work with Qt anymore and every time I've come back to this I have run into various problems trying to get it going again. This time I made it through the five days of work to get the release out (fingers crossed that it actually works). It would be great to get some community involvement around updating and debugging whatever issues come up. Maybe the next Python, Qt, or PyQt release will provide an opportunity for someone to offer that. Maybe I'll find time to continue cleaning this up so it's a bit more maintainable. If interested, there's been some discussion about the project at #110.

In an effort to make it easier to monitor issues around the latest release I am closing this issue. Discussion can continue if still applicable, but I want to make it easier to move forward. If there are issues with the new releases, please open new issues.

Things to be aware of that may ease some cases:

  • If you just want the Qt applications, you can directly use qt-tools which provides helpers around qt-applications. This skips the PyQt specific layers. You won't have access to the plugins, such as for showing custom PyQt Designer widget plugins in Designer, but you also won't have the hassle of needing a version matching your PyQt version. At least not quite as closely.
  • If I once again fail to maintain this, or you just want a specific version I didn't include, you can set environment variables to select the versions when building. PYQT_VERSION=6.5.0 QT_VERSION=6.5.2 venv/bin/pip install git+https://github.com/altendky/qt-applications@v2.3 for example would try to build and install qt-applications v2.3 including (a theoretical future) PyQt version 6.5.0 and Qt 6.5.2. I'm sure there are corners around this, but it would be relevant.

@amorcayReal
Copy link

Resolved by installing Python 3.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants