Skip to content
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

cx-Freeze causing circular imports? #2497

Closed
Ploso0247 opened this issue Jul 10, 2024 · 1 comment · Fixed by #2581
Closed

cx-Freeze causing circular imports? #2497

Ploso0247 opened this issue Jul 10, 2024 · 1 comment · Fixed by #2581

Comments

@Ploso0247
Copy link

I've never posted here before, but this time I'm genuinely stuck. I'm using cx_Freeze on a python script that uses pdf2docx. Running the python script normally works fine, but running cx_Freeze's executable gives this error:

Traceback (most recent call last):
  File "C:\Users\truma\AppData\Local\Programs\Python\Python312\Lib\site-packages\pymupdf\__init__.py", line 193, in <module>
    from . import mupdf
ImportError: cannot import name 'mupdf' from partially initialized module 'pymupdf' (most likely due to a circular import) (C:\Users\truma\Documents\ballotreaderclone\ballotreader\resources\build\exe.win-amd64-3.12\lib\pymupdf\__init__.pyc)

I've tried every suggestion chatgpt had, but nothing worked.

From my analysis it seems like cx_Freeze is messing up the order of imports in all the different python files, and ends up tying itself in a knot that it can't get out of... or something.

I've also tried reinstalling pdf2docx, pymupdf, cx_Freeze, and pip.

To be clear, everything works fine when the script is run from python and even with pyinstaller, but this problem happens with cx_Freeze in particular.

Originally posted by @Ploso0247 in #2496

@Ploso0247 Ploso0247 changed the title cx-Freeze causing circular improts? cx-Freeze causing circular imports? Jul 10, 2024
@marcelotduarte
Copy link
Owner

Release 7.2.2 is out!
Documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants