MCMi460 / 3DS-RPC

Connect your 3DS playing status to Discord!
https://3dsrpc.com/
149 stars 8 forks source link

Error building dependencies #11

Closed nreef12 closed 1 year ago

nreef12 commented 1 year ago

When I run python3 -m pip install -r requirements.txt, it fails and says this:

  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
  ╰─> [20 lines of output]
      Querying qmake about your Qt installation...
      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/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/_7/qfyb532d0r748fr_5phbnyx80000gn/T/pip-build-env-atnrjekv/overlay/lib/python3.11/site-packages/sipbuild/api.py", line 46, in build_wheel
          project = AbstractProject.bootstrap('wheel',
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/_7/qfyb532d0r748fr_5phbnyx80000gn/T/pip-build-env-atnrjekv/overlay/lib/python3.11/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
          project.setup(pyproject, tool, tool_description)
        File "/private/var/folders/_7/qfyb532d0r748fr_5phbnyx80000gn/T/pip-build-env-atnrjekv/overlay/lib/python3.11/site-packages/sipbuild/project.py", line 601, in setup
          self.update(tool)
        File "/private/var/folders/_7/qfyb532d0r748fr_5phbnyx80000gn/T/pip-install-rixjb730/pyqt5_aa8cfda52c6d4c90935a49f5c23ec10e/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.

I'm on macOS 13.2, how do I fix this?

MCMi460 commented 1 year ago

Are you on an Apple Silicon Mac? From what I can tell, this seems to be a sip/PyQt5 thing. What I usually do is install brew and then run brew install pyqt@5 (as seen here). From then on, installing PyQt5 over pip works without error. Please tell me if you have any further issues with this.

nreef12 commented 1 year ago

Did that, gives me the same error...

MCMi460 commented 1 year ago

When you run python3 -m pip freeze, what do you see? It should show you PyQt5 in there. Also, what exactly is the context for this error? I can't tell from the excerpt that you sent. (I can see that it says "installing build dependencies," but I can't tell for sure for what. Though, given sip, I'm pretty sure it's PyQt5)

nreef12 commented 1 year ago

When you run python3 -m pip freeze, what do you see? It should show you PyQt5 in there. Also, what exactly is the context for this error? I can't tell from the excerpt that you sent. (I can see that it says "installing build dependencies," but I can't tell for sure for what. Though, given sip, I'm pretty sure it's PyQt5)

Sorry, here's the full output:

❯ python3 -m pip install -r requirements.txt
Requirement already satisfied: requests in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r requirements.txt (line 1)) (2.28.1)
Collecting xmltodict
  Using cached xmltodict-0.13.0-py2.py3-none-any.whl (10.0 kB)
Collecting pypresence
  Using cached pypresence-4.2.1-py2.py3-none-any.whl (11 kB)
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
  ╰─> [20 lines of output]
      Querying qmake about your Qt installation...
      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/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/_7/qfyb532d0r748fr_5phbnyx80000gn/T/pip-build-env-y8h3d223/overlay/lib/python3.11/site-packages/sipbuild/api.py", line 46, in build_wheel
          project = AbstractProject.bootstrap('wheel',
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/_7/qfyb532d0r748fr_5phbnyx80000gn/T/pip-build-env-y8h3d223/overlay/lib/python3.11/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
          project.setup(pyproject, tool, tool_description)
        File "/private/var/folders/_7/qfyb532d0r748fr_5phbnyx80000gn/T/pip-build-env-y8h3d223/overlay/lib/python3.11/site-packages/sipbuild/project.py", line 601, in setup
          self.update(tool)
        File "/private/var/folders/_7/qfyb532d0r748fr_5phbnyx80000gn/T/pip-install-7yztb36f/pyqt5_5ff61c813d124d728828d44a92274781/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.

It is a problem with PyQt.

Also, running python3 -m pip freeze gets this:

certifi==2022.9.24
charset-normalizer==2.1.1
click==8.1.3
click-man==0.4.1
ghp-import==2.1.0
idna==3.4
Jinja2==3.1.2
lxml==4.9.1
Markdown==3.3.7
MarkupSafe==2.1.1
mergedeep==1.3.4
mkdocs==1.4.2
packaging==21.3
Pillow==9.3.0
pyparsing==3.0.9
PySide6==6.4.0.1
PySide6-Addons==6.4.0.1
PySide6-Essentials==6.4.0.1
python-dateutil==2.8.2
PyYAML==6.0
pyyaml_env_tag==0.1
requests==2.28.1
shiboken6==6.4.0.1
six==1.16.0
urllib3==1.26.12
watchdog==2.2.1

No sign of PyQt.

MCMi460 commented 1 year ago

Perhaps your python3 is a different version from the brew-installed one. This article describes how brew interacts with Python on your computer. If you've installed a version of Python that takes the place of python3 in your PATH and is not supported by Homebrew, then there's no guarantee that doing anything with brew will help. Are you absolutely certain that brew install pyqt@5 does not work? If not, then you may need to find where brew's/the system's Python is. If it doesn't exist, try running brew install python@3.10? Try running python -m pip freeze instead of python3? Other than that, I doubt that I can help you very much since this seems to be a very specific to you development environment thing that I'm, by no means, qualified to help with.