carlosperate / ubittool

Utility to extract the contents of flash from a micro:bit, including MicroPython user code.
https://carlosperate.github.io/ubittool/
MIT License
16 stars 4 forks source link

Error installing Pyyaml==5.4.1 #20

Open pravic opened 1 year ago

pravic commented 1 year ago

Problem

~$ pipx install ubittool

pip seemed to fail to build package:
    pyyaml<6.0,>=5.1

Some possibly relevant errors from pip install:
    error: subprocess-exited-with-error
    AttributeError: cython_sources

Error installing ubittool.

And from the install log:

Collecting pyyaml<6.0,>=5.1 (from pyocd==0.19.0->ubittool)
  Downloading PyYAML-5.4.1.tar.gz (175 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 175.1/175.1 kB 715.9 kB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'

PIP STDERR
----------
  error: subprocess-exited-with-error

Looks like there's a problem in https://github.com/yaml/pyyaml/issues/724

Workaround

A workaround is to specify an earlier pyyaml version:

$ echo 'pyyaml!=6.0.0,!=5.4.0,!=5.4.1' > pyyaml.txt
$ pipx install ubittool --pip-args '-c pyyaml.txt'
pravic commented 1 year ago

Also, the current pyocd version is 0.35 but this tool uses https://github.com/carlosperate/ubittool/blob/678081543a1413bd0c51323e33b289727d3adb66/requirements.txt#L5

carlosperate commented 1 year ago

If the issue is with Cython 3.0, would it work by specifying Cython<3 as a dependency in ubittool before listing pyocd?

Also, the current pyocd version is 0.35 but this tool uses

https://github.com/carlosperate/ubittool/blob/678081543a1413bd0c51323e33b289727d3adb66/requirements.txt#L5

Yes, but newer versions of PyOCD are harder to packaged with PyInstaller. I believe there is a branch or GitHub issue somewhere with some progress and/or instructions on how to get it to run with PyInstaller, but it's not something I've been able to do yet. If you feel up to the challenge I'd be happy to review and merge a PR with an updated PyOCD & PyInstaller recipe.