ImportError:无法导入名称“ FFProbe”

发布于 2021-01-29 15:04:57

我无法使ffprobe软件包在Python
3.6中工作。我使用pip安装了它,但是当我输入import ffprobe时说

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'
  • init.py文件仅包含一行from ffprobe import FFProbe

  • sys.path 包括“ C:\ Python \ Python36 \ lib \ site-packages”,这是ffprobe目录所在的位置。

  • 安装和导入软件包在Python 2.7中都可以正常工作。但是我想在Python 3中使用它,即使这意味着对.py文件进行手动更改。(没有文档说明该软件包仅在Python 2中有效。)

有人可以帮忙吗?

关注者
0
被浏览
91
1 个回答
  • 面试哥
    面试哥 2021-01-29
    为面试而生,有面试问题,就找面试哥。

    解决方案是ffprobe软件包仅适用于Python 2。

    在Python 3中,import语句将需要为from .ffprobe ...,但仅对其进行更改是不够的,因为还有其他几行仅在Python
    2中也适用。

    感谢Rawing。



知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看