Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on macOS #205

Closed
faxotherapy opened this issue Dec 22, 2024 · 6 comments
Closed

Not working on macOS #205

faxotherapy opened this issue Dec 22, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@faxotherapy
Copy link

Environment (please complete the following information):

  • OS: macOS Monterey
  • python version: 3.12
  • subsync version (subsync --version): 0.17.0

Describe the bug
Crash right from the beginning.

To Reproduce
Simply run script under macOS

Expected behavior
Synced subtitle to be ouput.

Output

ffs Movie.mkv -i Movie.srt -o Movie_.srt
[23:09:48] INFO     extracting speech segments from reference 'Movie.mkv'...     ffsubsync.py:436
           INFO     Checking video for subtitles stream...                                                    speech_transformers.py:309
           INFO     Video file appears to lack subtitle stream                                                speech_transformers.py:314
Traceback (most recent call last):
  File "/Users/N/.local/bin/ffs", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/N/Library/Application Support/pipx/venvs/ffsubsync/lib/python3.12/site-packages/ffsubsync/ffsubsync.py", line 719, in main
    return run(parser)["retval"]
           ^^^^^^^^^^^
  File "/Users/N/Library/Application Support/pipx/venvs/ffsubsync/lib/python3.12/site-packages/ffsubsync/ffsubsync.py", line 501, in run
    sync_was_successful = _run_impl(args, result)
                          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/N/Library/Application Support/pipx/venvs/ffsubsync/lib/python3.12/site-packages/ffsubsync/ffsubsync.py", line 437, in _run_impl
    reference_pipe.fit(args.reference)
  File "/Users/N/Library/Application Support/pipx/venvs/ffsubsync/lib/python3.12/site-packages/ffsubsync/sklearn_shim.py", line 255, in fit
    self._final_estimator.fit(Xt, y, **fit_params)
  File "/Users/N/Library/Application Support/pipx/venvs/ffsubsync/lib/python3.12/site-packages/ffsubsync/speech_transformers.py", line 333, in fit
    detector = _make_webrtcvad_detector(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/N/Library/Application Support/pipx/venvs/ffsubsync/lib/python3.12/site-packages/ffsubsync/speech_transformers.py", line 136, in _make_webrtcvad_detector
    import webrtcvad
  File "/Users/N/Library/Application Support/pipx/venvs/ffsubsync/lib/python3.12/site-packages/webrtcvad.py", line 1, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

Test case
[Optional] You can bundle additional debugging information into a tar archive as follows:

% subsync In.mkv -i In.srt -o Out.srt
unrecognized option 'In.mkv'
Traceback (most recent call last):
  File "subsync", line 6, in <module>
  File "subsync/__main__.py", line 16, in subsync
AttributeError: 'NoneType' object has no attribute 'get'
[66821] Failed to execute script 'subsync' due to unhandled exception: 'NoneType' object has no attribute 'get'
[66821] Traceback:
(null

This will create a file vid.mkv.$timestamp.tar.gz or similar a few KiB in size; you can attach it by clicking the "attach files" button below.

Obvious, it's failing again.

Additional context
Add any other context about the problem here.

@faxotherapy faxotherapy added the bug Something isn't working label Dec 22, 2024
@junkblocker
Copy link

Seems independent on the OS as I am seeing this on Fedora too.

@smacke
Copy link
Owner

smacke commented Dec 23, 2024

Seems like the same thing as in #203, could you try the remediation there and see if that works?

@junkblocker
Copy link

junkblocker commented Dec 23, 2024

I did and it did not work. I already had setuptools installed.

@smacke
Copy link
Owner

smacke commented Dec 23, 2024

pkg_resources is a package that's part of setuptools. I recommend verifying that it's installed in the same environment as ffsubsync. I'm going to add setuptools as an explicit dependency since it seems it doesn't come preinstalled in python 3.12 anymore, but you'll want to check that it's present.

To verify, you can run

ls "$(dirname $(which ffs))"/../lib/python3.12/site-packages

and if you don't see pkg_resources there, chances are you also won't see setuptools there, and the fix is to make sure setuptools gets installed to there.

@junkblocker
Copy link

I reinstalled it before seeing this. An install via uv tool seemed to have done something bad and remove and reinstall via pipx fixed it.

@smacke
Copy link
Owner

smacke commented Dec 25, 2024

Glad to hear!

@smacke smacke closed this as completed Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants