PyQt5 / PyQt

PyQt Examples(PyQt各种测试和例子) PyQt4 PyQt5
GNU Lesser General Public License v2.1
6.65k stars 1.97k forks source link

PyQt5 cannot be installed #185

Closed Killpit closed 1 year ago

Killpit commented 1 year ago

Environment : / 环境

Trying to install for labellmg library, having problem installing, looked at the problem from Stack Overflow and separately installed lxml.

(venv) atatekeli:waste-detection atatekeli$ pip install PyQt5
Collecting PyQt5
  Using cached PyQt5-5.15.9.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
  ╰─> [17 lines of output]
      Querying qmake about your Qt installation...
      Traceback (most recent call last):
        File "/Users/atatekeli/waste-detection/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/atatekeli/waste-detection/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/atatekeli/waste-detection/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
        File "/private/var/folders/y4/jnpd1pl92r50hk6sfmrcq20c0000gn/T/pip-build-env-zqneq4pb/overlay/lib/python3.10/site-packages/sipbuild/api.py", line 46, in build_wheel
          project = AbstractProject.bootstrap('wheel',
        File "/private/var/folders/y4/jnpd1pl92r50hk6sfmrcq20c0000gn/T/pip-build-env-zqneq4pb/overlay/lib/python3.10/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
          project.setup(pyproject, tool, tool_description)
        File "/private/var/folders/y4/jnpd1pl92r50hk6sfmrcq20c0000gn/T/pip-build-env-zqneq4pb/overlay/lib/python3.10/site-packages/sipbuild/project.py", line 602, in setup
          self.update(tool)
        File "/private/var/folders/y4/jnpd1pl92r50hk6sfmrcq20c0000gn/T/pip-install-cf_xbj3g/pyqt5_0a8cd463ee7b407faaca73c7952dd14d/project.py", line 165, in update
          raise UserException(
      sipbuild.exceptions.UserException
      [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.
892768447 commented 1 year ago

https://github.com/PyQt5/PyQt/issues/138

https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html#building-and-installing-from-source

Killpit commented 1 year ago

138

https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html#building-and-installing-from-source

Tried it and still failed to install it

892768447 commented 1 year ago

I'll try it tomorrow. The other way is install x64 python on Apple Silicon M1. because most x64 application can run on M1

Killpit commented 1 year ago

sip-install: pyproject.toml: there is no such file in the current directory, did headway but I highly doubt it'd make it far from working @892768447

Killpit commented 1 year ago

Also installed sip and still didn't work with instructions

892768447 commented 1 year ago

@bbhxwl

The simplest solution:

  1. https://www.python.org/downloads/macos/
  2. download Python 3.9.13 - May 17, 2022 Download macOS 64-bit Intel-only installer https://www.python.org/ftp/python/3.9.13/python-3.9.13-macosx10.9.pkg
  3. install python-3.9.13-macosx10.9.pkg

    Custom

屏幕截图 2023-10-07 105612

Install or upgrade pip

屏幕截图 2023-10-07 104323

  1. /Library/Frameworks/Python.framework/Versions/3.9/bin/pip3 install PyQt5
  2. /Library/Frameworks/Python.framework/Versions/3.9/bin/python3

屏幕截图 2023-10-07 104707

Killpit commented 1 year ago

Would it create problem with Apple Silicon chips, because when I previously installed with Intel chips, one of the programs didn't work

892768447 commented 1 year ago

Usually, it can work normally. Just like the results of my tests above

Killpit commented 1 year ago

Do you have ARM of Intel Chip for Mac

892768447 commented 1 year ago

Do you have ARM of Intel Chip for Mac

I test on QQ截图20231007202613

892768447 commented 11 months ago

you can install Miniconda3 macOS Apple M1 64-bit pkg

conda install -c conda-forge pyqt