question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't delocate wheel with AttributeError after a regex returns no match in `parse_install_name`.

See original GitHub issue

I’m running delocate on github actions on a osx build and it errors out with the following error:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/delocate-wheel", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/cmd/delocate_wheel.py", line 71, in main
    check_verbose=opts.verbose)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/delocating.py", line 377, in delocate_wheel
    lib_filt_func, copy_filt_func)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/delocating.py", line 289, in delocate_path
    return copy_recurse(lib_path, copy_filt_func, copied)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/delocating.py", line 145, in copy_recurse
    _copy_required(lib_path, copy_filt_func, copied_libs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/delocating.py", line 201, in _copy_required
    lib_dict = tree_libs(lib_path)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/libsana.py", line 60, in tree_libs
    for install_name in get_install_names(depending_libpath):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/tools.py", line 219, in get_install_names
    names = tuple(parse_install_name(line)[0] for line in lines[1:])
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/tools.py", line 219, in <genexpr>
    names = tuple(parse_install_name(line)[0] for line in lines[1:])
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/tools.py", line 151, in parse_install_name
    return IN_RE.match(line).groups()
AttributeError: 'NoneType' object has no attribute 'groups'

The command I’m running is delocate-wheel dist/*.whl, and the result of ls dist/ prints ffpyplayer-4.3.2.dev0-cp36-cp36m-macosx_10_9_x86_64.whl indicating that the file is there.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
matthew-brettcommented, Oct 13, 2021

You can always build wheels for the two architectures, delocate them, and then fuse them into one wheel with the delocate-fuse command.

1reaction
HexDecimalcommented, Oct 12, 2021

That’s perfect, showing the otool output makes it clear what happened.

https://github.com/matthew-brett/delocate/blob/9c2c6a42c96b02602ce8d2059423a77e257a1a98/delocate/tools.py#L252

This code here removes only the first line which is supposed to be the “architecture” line and then doesn’t expect there to be a 2nd architecture. This seems to cause the current error.

Right now I don’t know what the correct way of handling this is supposed to be. I’d guess ignoring the separate architectures and merging the sets of libraries might work. I wasn’t able to reproduce the error so I can’t write a test for this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Regex: AttributeError: 'NoneType' object has no attribute 'groups'
You are getting AttributeError because you're calling groups on None , which hasn't any methods. regex.search returning None means the regex couldn't find ......
Read more >
re — Regular expression operations — Python 3.11.1 ...
Source code: Lib/re/ This module provides regular expression matching ... these do not allow back-tracking when the expression following it fails to match....
Read more >
Best Practices for Regular Expressions in .NET - Microsoft Learn
Regular expression patterns are often written to match valid input. That is, developers examine the text that they want to match and then...
Read more >
[3.6.4] AttributeError: module 'regex' has no attribute 'Pattern'
Since I upgraded nltk from 3.6.2 to 3.6.4, the following code : from nltk.tokenize.casual import TweetTokenizer, casual_tokenize raises the ...
Read more >
regex · PyPI
Keeps the part of the entire match after the position where \K occurred; the part before it is discarded. It does not affect...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found