Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name 'FFProbe'

I can't get the ffprobe package to work in Python 3.6. I installed it using pip, but when I type import ffprobe it says

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python\Python36\lib\site-packages\ffprobe\__init__.py", line 1, in <module>
  from ffprobe import FFProbe
ImportError: cannot import name 'FFProbe'
  • The __init__.py file contains just the single line from ffprobe import FFProbe.

  • sys.path includes 'C:\Python\Python36\lib\site-packages', which is where the ffprobe directory is located.

  • Installing and importing the package works in Python 2.7 with no problems. But I would like to use it in Python 3, even if that means making manual changes to the .py files. (There is no documentation that says the package only works in Python 2.)

Can anyone help?

like image 780
user1310503 Avatar asked Mar 10 '23 00:03

user1310503


2 Answers

Use this ffprobe package instead for Python3. Works for me: pip install ffprobe-python

like image 60
I Like Avatar answered Mar 11 '23 14:03

I Like


The solution is that the ffprobe package only works with Python 2.

In Python 3 the import statement would need to be from .ffprobe ..., but just changing that is not sufficient as there are other lines that only work in Python 2 as well.

Thanks to Rawing.

like image 33
user1310503 Avatar answered Mar 11 '23 14:03

user1310503