DigiScore / neoscore

A python library for notating music in a graphics-first paradigm
https://neoscore.org
BSD 3-Clause "New" or "Revised" License
108 stars 9 forks source link

pyQT M1 Mac woes #49

Closed johnaulich92 closed 2 years ago

johnaulich92 commented 2 years ago

I saw the Rosetta solution but it hasn't worked for me unfortunately: Attempting to install PyQt5 directly generates a similar error.

johnaulich@john-2 ~ % python3.10 -m venv env   
johnaulich@john-2 ~ % source env/bin/activate  
(env) johnaulich@john-2 ~ % python --version
Python 3.10.4
(env) johnaulich@john-2 ~ % pip install --upgrade pip
Requirement already satisfied: pip in ./env/lib/python3.10/site-packages (22.1.2)
(env) johnaulich@john-2 ~ % pip install neoscore     
Collecting neoscore
  Using cached neoscore-0.1.1-py3-none-any.whl (934 kB)
Collecting img2pdf==0.4.3
  Using cached img2pdf-0.4.3.tar.gz (98 kB)
  Preparing metadata (setup.py) ... done
Collecting sortedcontainers==2.4.0
  Using cached sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Collecting PyQt5<6.0.0,>=5.15.6
  Using cached PyQt5-5.15.7.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
  ╰─> [24 lines of output]
      Querying qmake about your Qt installation...
      Traceback (most recent call last):
        File "/Users/johnaulich/env/lib/python3.10/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/johnaulich/env/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/Users/johnaulich/env/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/johnaulich/env/lib/python3.10/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 "/private/var/folders/80/wdttptns7gz44ttky392mh4w0000gn/T/pip-build-env-h2vrtrt6/overlay/lib/python3.10/site-packages/sipbuild/api.py", line 46, in build_wheel
          project = AbstractProject.bootstrap('wheel',
        File "/private/var/folders/80/wdttptns7gz44ttky392mh4w0000gn/T/pip-build-env-h2vrtrt6/overlay/lib/python3.10/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
          project.setup(pyproject, tool, tool_description)
        File "/private/var/folders/80/wdttptns7gz44ttky392mh4w0000gn/T/pip-build-env-h2vrtrt6/overlay/lib/python3.10/site-packages/sipbuild/project.py", line 600, in setup
          self.update(tool)
        File "/private/var/folders/80/wdttptns7gz44ttky392mh4w0000gn/T/pip-install-gwb86hec/pyqt5_07517a0f769a496c8bef07a27bd9041a/project.py", line 166, 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 Mac OS X 12.4 and this is an M1 Max machine fwiw.

ajyoon commented 2 years ago

Hmm, as far as I know, in #35 we worked through just about every troubleshooting step we could find on this problem. If none of these solutions work for even installing PyQt5 alone, I'm afraid we might need to take that issue upstream to PyQt5. When you try installing PyQt5 directly (which I think is how we should debug this issue), are you installing the latest 5.15.7? That came out last week and might help the issue.

johnaulich92 commented 2 years ago

yes, it is 5.15.7 sadly! thanks for your response.

ajyoon commented 2 years ago

Out of curiosity, if you have other python 3.x versions available on your system, are you able to install PyQt5 in them? Maybe the wheels aren't as available for 3.10 since it's newer.

johnaulich92 commented 2 years ago

No I'm fairly new to python and only have 3.10 as far as I know

ajyoon commented 2 years ago

Does it help if you install 5.15.6 specifically with pip install PyQt5==5.15.6? Maybe 5.15.7 is broken

johnaulich92 commented 2 years ago

Unfortunately no :( I have an intel machine I can dig out

On 23 Jun 2022, at 11:37, Andrew Yoon @.***> wrote:

Does it help if you install 5.15.6 specifically with pip install PyQt5==5.15.6? Maybe 5.15.7 is broken

— Reply to this email directly, view it on GitHub https://github.com/DigiScore/neoscore/issues/49#issuecomment-1164567858, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZYQWRXDCXE2LP56QL7RK5LVQSAEBANCNFSM5ZUJBK4A. You are receiving this because you authored the thread.

ajyoon commented 2 years ago

sorry for the stalled progress here, we're going to be looking into lowering our minimum python version to 3.9 on a hunch it could avoid a lot of these issues. I think wheel support is just not great for newer python versions.

johnaulich92 commented 2 years ago

Thanks Andrew, please keep me posted on this!

I’m happy to test anything out that you need me to.

On 1 Jul 2022, at 12:51, Andrew Yoon @.***> wrote:

sorry for the stalled progress here, we're going to be looking into lowering our minimum python version to 3.9 on a hunch it could avoid a lot of these issues. I think wheel support is just not great for newer python versions.

— Reply to this email directly, view it on GitHub https://github.com/DigiScore/neoscore/issues/49#issuecomment-1172537860, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZYQWRUB422GOZIGCAUPCFTVR4OZ7ANCNFSM5ZUJBK4A. You are receiving this because you authored the thread.

ajyoon commented 2 years ago

Oh actually it would be very helpful if you could try installing PyQt5 on a Python 3.9 virtual environment. That would help us know if it would improve the situation.

johnaulich92 commented 2 years ago

Unfortunately it's a similar problem


johnaulich@john-2 ~ % source env/bin/activate
(env) johnaulich@john-2 ~ % pip install --upgrade pip
Requirement already satisfied: pip in ./env/lib/python3.9/site-packages (22.1.2)
(env) johnaulich@john-2 ~ % pip install PyQt5        
Collecting PyQt5
  Using cached PyQt5-5.15.7.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
  ╰─> [23 lines of output]
      Querying qmake about your Qt installation...
      Traceback (most recent call last):
        File "/Users/johnaulich/env/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/johnaulich/env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/Users/johnaulich/env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/johnaulich/env/lib/python3.9/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 "/private/var/folders/80/wdttptns7gz44ttky392mh4w0000gn/T/pip-build-env-hugt05x0/overlay/lib/python3.9/site-packages/sipbuild/api.py", line 46, in build_wheel
          project = AbstractProject.bootstrap('wheel',
        File "/private/var/folders/80/wdttptns7gz44ttky392mh4w0000gn/T/pip-build-env-hugt05x0/overlay/lib/python3.9/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
          project.setup(pyproject, tool, tool_description)
        File "/private/var/folders/80/wdttptns7gz44ttky392mh4w0000gn/T/pip-build-env-hugt05x0/overlay/lib/python3.9/site-packages/sipbuild/project.py", line 600, in setup
          self.update(tool)
        File "project.py", line 166, in update
      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.```
ajyoon commented 2 years ago

ah bummer.. does that work under rosetta by any chance?

Actually, I'm seeing now that the prebuilt wheels only exist for 3.7, could you try installing PyQt5 on 3.7?

johnaulich92 commented 2 years ago

Okay, this took a bit of doing! PyQt5 successfully installs on 3.7 on Rosetta.

Just fyi 3.7 itself won’t install natively.

On 1 Jul 2022, at 14:02, Andrew Yoon @.***> wrote:

ah bummer.. does that work under rosetta by any chance?

Actually, I'm seeing now that the prebuilt wheels only exist for 3.7 https://pypi.org/project/PyQt5/5.15.7/#files, could you try installing PyQt5 on 3.7?

— Reply to this email directly, view it on GitHub https://github.com/DigiScore/neoscore/issues/49#issuecomment-1172589977, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZYQWRQHAWQLRJYTZKISGPTVR4XEZANCNFSM5ZUJBK4A. You are receiving this because you authored the thread.

ajyoon commented 2 years ago

Thanks for checking that! We've just released neoscore 0.1.3 which reduces the minimum supported Python version to 3.7, so you should be able to install neoscore on it now (with Rosetta). Please let us know if this works!

johnaulich92 commented 2 years ago

Success! Thanks.

Now to actually try it out…

On 7 Jul 2022, at 12:25, Andrew Yoon @.***> wrote:

Thanks for checking that! We've just released neoscore 0.1.3 https://github.com/DigiScore/neoscore/discussions/56 which reduces the minimum supported Python version to 3.7, so you should be able to install neoscore on it now (with Rosetta). Please let us know if this works!

— Reply to this email directly, view it on GitHub https://github.com/DigiScore/neoscore/issues/49#issuecomment-1177889324, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZYQWRQHRIO3SLSBNYTURC3VS4AHRANCNFSM5ZUJBK4A. You are receiving this because you authored the thread.