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.

[Bug] AttributeError: module 'ffmpeg' has no attribute '_run'

See original GitHub issue
  • I didn’t find a similar issue already open.
  • I read the documentation (README AND Wiki)
  • I have installed FFMpeg
  • My problem is related to Spleeter only, not a derivative product (such as Webapplication, or GUI provided by others)

Description

I tried to use Spleeter on linux KDE yet still, it shows this error when I enter the following: spleeter separate -p "/home/mohammedmehditber/Documents/base_config.json" -o "output_mwf" -f {filename}-{instrument}.{codec} -d 7200 -c mp3 -b 320k --mwf -B tensorflow "/media/mohammedmehditber/0E2E5DD12E5DB287/Users/Windo/Music/Muhammad Al Muqit/Anasheeds, Vol. 4/1-04 Graduation.mp3"

Output

spleeter separate -p "/home/mohammedmehditber/Documents/base_config.json" -o "output_mwf" -f {filename}-{instrument}.{codec} -d 7200 -c mp3 -b 320k --mwf -B tensorflow "/media/mohammedmehditber/0E2E5DD12E5DB287/Users/Windo/Music/Muhammad Al Muqit/Anasheeds, Vol. 4/1-04 Graduation.mp3"
Traceback (most recent call last):
  File "/root/anaconda3/lib/python3.8/site-packages/spleeter/audio/ffmpeg.py", line 101, in load
    probe = ffmpeg.probe(path)
AttributeError: module 'ffmpeg' has no attribute 'probe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/anaconda3/bin/spleeter", line 8, in <module>
    sys.exit(entrypoint())
  File "/root/anaconda3/lib/python3.8/site-packages/spleeter/__main__.py", line 256, in entrypoint
    spleeter()
  File "/root/anaconda3/lib/python3.8/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/root/anaconda3/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/root/anaconda3/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/root/anaconda3/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/root/anaconda3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/root/anaconda3/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/root/anaconda3/lib/python3.8/site-packages/typer/main.py", line 497, in wrapper
    return callback(**use_params)  # type: ignore
  File "/root/anaconda3/lib/python3.8/site-packages/spleeter/__main__.py", line 128, in separate
    separator.separate_to_file(
  File "/root/anaconda3/lib/python3.8/site-packages/spleeter/separator.py", line 376, in separate_to_file
    waveform, _ = audio_adapter.load(
  File "/root/anaconda3/lib/python3.8/site-packages/spleeter/audio/ffmpeg.py", line 102, in load
    except ffmpeg._run.Error as e:
AttributeError: module 'ffmpeg' has no attribute '_run'

Environment

OS / Linux /
Installation type pip
RAM available 6Go
Hardware spec Intel HD 3000 / Core i5 /
Product Name Toshiba Satellite L750/L755

Issue Analytics

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

github_iconTop GitHub Comments

8reactions
DanielHammerincommented, Mar 31, 2021

Maybe you already solved it but I just ran sudo pkcon install ffmpeg in my terminal and then pip3 install ffmpeg in my project venv. This gave me AttributeError: module 'ffmpeg' has no attribute '_run' Which I found the solution to in this Solution:

pip install ffmpeg-python instead of pip install ffmpeg

But wait. There’s more.

I’m guessing this happens if you’ve installed both, ffmpeg and ffmpeg-python. uninstall both with: pip uninstall ffmpeg pip uninstall ffmpeg-python and install ffmpeg-python again with : pip install ffmpeg-python This solved the problem in my system 😃

Now I have a working spleeter lib in my project.

1reaction
romi1502commented, Mar 12, 2021

Hi @MohammedMehdiTBER, I cannot reproduce your issue. The ffmpeg module that is imported by spleeter seems not to be the right one (as the correct one is supposed to have both a probe and a _run attribute). The right one, is the one installed by the ffmpeg-python package (which is a dependency of spleeter that should have been installed by pip). You should check that it was correctly installed by pip and is not overriden by another package (installed by pip or conda or a local one).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python ffmpeg-python causes WinError2/ffmpeg has no ...
Show activity on this post. I was trying to make mp4/mp3 converter using ffmpeg, but ffmpeg is causing WinError2. Make sure both FFmpeg...
Read more >
kivy-examples/demo/kivycatalog won't play... - Google Groups
AttributeError : module 'ffmpeg' has no attribute 'FFVideo'. " Now the catalog demo won't run at ... There errors are not a problem...
Read more >
Troubleshooting for installation | mpegCoder
Question: When importing the module, why meeting the following error? AttributeError: type object 'tqdm' has no attribute 'wrapattr'.
Read more >
AttributeError: module 'torch' has no attribute 'rfft' with PyTorch
I am getting an error using a code that should work according to the documentation. The goal is to calculate the Feature Similarity...
Read more >
Tips and Troubleshooting — Katna documentation
... get “AttributeError: module 'cv2.cv2' has no attribute 'saliency'” error. ... 4) If you are running the code on windows, make sure to...
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