ffprobe-python
ffprobe-python copied to clipboard
ImportError: cannot import name 'FFProbe' from partially initialized module 'ffprobe'
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.
I was having the same issue when my script file was called ffprobe.py. Check your filename.
I was having the same issue when my script file was called ffprobe.py. Check your filename.
how did you fix this problem?
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.
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 >>>
)!
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
Using ffprobe-0.5-py3, python -c 'import ffprobe'
Triggers this problem, this is not caused by a file named "ffprobe.py" in cwd.
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.
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.