ffprobe-python icon indicating copy to clipboard operation
ffprobe-python copied to clipboard

ImportError: cannot import name 'FFProbe' from partially initialized module 'ffprobe'

Open sgraaf opened this issue 4 years ago • 8 comments

Hi! I just installed your ffprobe wrapper directly from PyPi, but when I tried to use it (as per the example), I get the following error:

>>> from ffprobe import FFProbe
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\sgraaf\AppData\Roaming\Python\Python39\site-packages\ffprobe\__init__.py", line 1, in <module>
    from ffprobe import FFProbe
ImportError: cannot import name 'FFProbe' from partially initialized module 'ffprobe' (most likely due to a circular import) (C:\Users\sgraaf\AppData\Roaming\Python\Python39\site-packages\ffprobe\__init__.py)

I am using ffprobe 0.5 w/ Python 3.9.0 on Windows 10 X64.

sgraaf avatar Dec 24 '20 13:12 sgraaf

I was having the same issue when my script file was called ffprobe.py. Check your filename.

hugomcruz avatar Feb 27 '21 04:02 hugomcruz

I was having the same issue when my script file was called ffprobe.py. Check your filename.

how did you fix this problem?

sohpark avatar Apr 12 '21 22:04 sohpark

Do you have any file in your project called ffprobe.py? If you have, rename it with some other name.

I had a file in my project with this name, and that was causing the issue, as the FFProbe class is in a ffprobe.py file.

hugomcruz avatar Apr 13 '21 00:04 hugomcruz

I was having the same issue when my script file was called ffprobe.py. Check your filename.

There's no filename to check: I ran into this error directly from the Python REPL (as you might have been able to tell from the >>>)!

sgraaf avatar Apr 21 '21 11:04 sgraaf

This is most likely because of the use of the VERY old PyPi package ffprobe, instead of the current one for this project, ffprobe-python

RobMullen avatar Dec 28 '22 19:12 RobMullen

Using ffprobe-0.5-py3, python -c 'import ffprobe' Triggers this problem, this is not caused by a file named "ffprobe.py" in cwd.

mozai avatar Mar 18 '23 04:03 mozai

Reviving since I'm having the same issue as well. I'm running something using pydub in a Jupyter notebook in a virtual python environment. Both ffmpeg and ffprobe are installed in my environment and located in site-packages. I tried the following at the top of the file:

import sys
sys.path.append('/Users/jake/PycharmProjects/py-venv/lib/python3.11/site-packages/ffmpeg')
sys.path.append('/Users/jake/PycharmProjects/py-venv/lib/python3.11/site-packages/ffprobe')
sys.path.append('/Users/jake/PycharmProjects/py-venv/lib/python3.11/site-packages/ffmpeg')

However, when I do import os; print(os.environ['PATH']), none of the above paths are returned.

Anyone had a look at this thread since then? Stumped on this.

hainesdata avatar Feb 10 '24 22:02 hainesdata

I had the exact same problem. How did I fix it? Turns out i installed this function using: pip install ffprobe, which as RobMullen points out above installs the very old PyPi version. So I uninstalled that one: pip uninstall ffprobe Then I re-installed the correct new one: pip install ffprobe-python. Wha la. Now working correctly. Ideally the docs would be updated to reflect this fact. As it took me a bit of time to figure this one out.

eggehad avatar Mar 02 '24 19:03 eggehad