ImportError: cannot import name 'FFProbe'

此生再无相见时 提交于 2020-06-16 09:17:11

问题


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?


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/44227378/importerror-cannot-import-name-ffprobe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!