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?
from .ffprobe import FFProbe
. – Vermisfrom ffprobe import FFProbe
works in Python 2 and why the dot is needed in Python 3? – Yamen.ffprobe
instead offfprobe
? – Yamenimport module_name
imports a module from python's library, whereasimport .module_name
imports a (sub-)module from the current module's directory. Withfrom ffprobe import
, the ffprobe module was importing itself, which makes no sense. Withfrom .ffprobe import
, it imports from theffprobe.py
file that's in the same directory as the__init__.py
. – Vermis