Closed s-lopez closed 6 months ago
Hi! Thanks for opening an issue.
I was unable to reproduce this issue by cloning the GitHub repository as it is now and installing it in a new Conda environment. Can you give me the exact steps you used to initialize your virtualenv?
Or better question: do you have FFmpeg installed? If not, I think it might be because I included FFMPEG_CODECS
in __all__
in __init__.py
, even if it was never defined if you don't have FFmpeg. It may also be possible that shutil
is not able to find your installation of FFmpeg: https://github.com/pyinstaller/pyinstaller/issues/5925.
I'm going to try my best to figure out the root cause, but I only have access to Windows and Ubuntu currently, not macOS. Hopefully this is an OS-independent issue!
Thanks!
Thanks to you for taking a look at this so quickly and for publishing your library!
Ok, good news: Installing FFmpeg with homebrew and installing the full dependencies from requirements.txt
does the trick. I can now successfully import the package. Thanks!
Now the details:
pip install -e .
still results in ModuleNotFoundError: No module named 'cryptography'
. Full trace:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "~/python/minim/src/minim/__init__.py", line 42, in <module>
from . import audio, itunes, qobuz, spotify, tidal, utility # noqa: E402
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/python/minim/src/minim/tidal.py", line 27, in <module>
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
So I'm guessing the issue is indeed OS-independent, except for the conda part, of course 😄
Thanks for the detailed response! I will address the cryptography issue when I get home and push a fix to GitHub.
@bbye98 I think other users might still see the circular import error if they don't have FFmpeg in their system.
Whoops! Forgot to update audio.py
. Hopefully this push fixes the issue.
Hello!
I was about to give minim a try, since it looks super interesting, and I'm getting this circular import error as soon as I try to import minim:
ImportError: cannot import name 'FFMPEG_CODECS' from partially initialized module 'minim' (most likely due to a circular import)
I followed the instructions to install the dependencies and the project in editable mode with virtualenv. I'm using Python 3.11 and macOS 14.3.1.
The error appears as soon as I import minim (
python -c "import minim"
).I've looked into it and indeed,
src/minim/__init__.py
containsfrom . import audio, itunes, qobuz, spotify, tidal, utility # noqa: E402
in line 42, andsrc/minim/audio.py
has the following in line 22:from . import utility, FOUND_FFMPEG, FFMPEG_CODECS
.FOUND_FFMPEG
is defined in__init__.py
.