-
-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: cannot import name 'utils' from partially initialized module 'pymupdf' (most likely due to a circular import) #2653
Comments
You can test with: |
Thanks a bunch for the quick fix! I'll give it a test once I hop in my Windows machine. |
Hm, I'm getting the following error when I try to run distutils.errors.DistutilsOptionError: no base named 'Win32GUI' ('Win32GUI-cpython-312-win_amd64') Maybe I'm missing something though. I'll try to figure it out and get back to you. |
You can get the wheel from this link. |
Ok, I just used that wheel, but now I'm seeing a different error: Traceback (most recent call last):
File "C:\Users\apyrg\AppData\Local\pypoetry\Cache\virtualenvs\dangerzone-kK8ZKSCU-py3.12\Lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 119, in run
module_init.run(f"__main__{name}")
File "C:\Users\apyrg\AppData\Local\pypoetry\Cache\virtualenvs\dangerzone-kK8ZKSCU-py3.12\Lib\site-packages\cx_Freeze\initscripts\console.py", line 25, in run
exec(code, main_globals)
File "install\windows\dangerzone-cli.py", line 1, in <module>
import dangerzone
File "C:\Users\apyrg\playground\dangerzone\dangerzone\__init__.py", line 27, in <module>
from .cli import cli_main as main
File "C:\Users\apyrg\playground\dangerzone\dangerzone\cli.py", line 5, in <module>
import click
File "C:\Users\apyrg\AppData\Local\pypoetry\Cache\virtualenvs\dangerzone-kK8ZKSCU-py3.12\Lib\site-packages\click\__init__.py", line 7, in <module>
from .core import Argument as Argument
File "C:\Users\apyrg\AppData\Local\pypoetry\Cache\virtualenvs\dangerzone-kK8ZKSCU-py3.12\Lib\site-packages\click\core.py", line 11, in <module>
from gettext import gettext as _
ModuleNotFoundError: No module named 'gettext' This errors happens even if I do the |
Ya. Try with the most recent. |
@apyrgio Can you test and give feedback? |
Sorry for the delay, it's just that I haven't managed to switch to my Windows machine yet. I'll let you know the soonest, most likely on Monday. |
Just managed to give it a whirl, and it works! |
Release 7.2.5 is out! |
Describe the bug
cx-Freeze cannot import the latest iteration of PyMuPDF (1.24.11 or greater).
To Reproduce
Install PyMuPDF in a virtual environment, and use cx-Freeze to create a bundle. The resulting .exe file cannot import PyMuPDf:
(taken from a user issue in the Dangerzone repo freedomofpress/dangerzone#974)
Expected behavior
PyMuPDF should be imported.
Screenshots
Desktop (please complete the following information):
Additional context
A similar issue was previously reported here (#2497) but the error is different this time. I believe the reason is that PyMuPDF underwent some architectural changes in the meantime.
Also, it's worth noting that the bundle works, if I explicitly specify the missing module, e.g., with
packages = [..., "pymupdf.utils"]
. I guess we need to load this module in the PyMuPDF hook, but it's not super clean.The text was updated successfully, but these errors were encountered: