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

py7zr fail to load on azure vm, because dependency brotli failed to load brotli DLL #527

Closed
yannou38 opened this issue Jul 26, 2023 · 6 comments · Fixed by #543
Closed
Labels
bug Something isn't working

Comments

@yannou38
Copy link

Describe the bug

On an Azure VM, py7zr couldn't load due to the brotlicffi module missing

Related issue
Found while looking at this issue.

To Reproduce
Unsure. Try to install py7zr on a newly created azure VM and call "python -m py7zr i" could trigger the error ?

Expected behavior

Environment (please complete the following information):

  • OS: Azure VM Windows
  • Python 3.11.1
  • py7zr version: 0.20.5

Additional context
Additional context can be found in linked issue

@miurahr
Copy link
Owner

miurahr commented Jul 26, 2023

brotlicffi is dependency for pypy, but you use CPython and log show a successful install of Brotli library.
It seems a problem where importing brotli library.

@miurahr miurahr changed the title py7zr fail to load on azure vm, missing brotlicffi py7zr fail to load on azure vm, failed to load brotli DLL Jul 26, 2023
@miurahr
Copy link
Owner

miurahr commented Jul 26, 2023

From traceback, a problem is as follows:

Traceback (most recent call last):
  File "C:\ghr\IOTSEC-gh-actions\1\_work\setup-qt\setup-qt\.venv\Lib\site-packages\py7zr\compressor.py", line 67, in <module>
    import brotli  # type: ignore  # noqa
    ^^^^^^^^^^^^^
  File "C:\ghr\IOTSEC-gh-actions\1\_work\setup-qt\setup-qt\.venv\Lib\site-packages\brotli.py", line 8, in <module>
    import _brotli
ImportError: DLL load failed while importing _brotli: The specified module could not be found.

It shows the error is happened in brotli.py from brotli library to fail loading _blotli.dll.

@miurahr miurahr changed the title py7zr fail to load on azure vm, failed to load brotli DLL py7zr fail to load on azure vm, because dependency brotli failed to load brotli DLL Jul 26, 2023
@miurahr
Copy link
Owner

miurahr commented Jul 26, 2023

Latest CI test is passed with brotli 1.0.9 on Python 3.11.4 on Windows in 3 weeks ago.
brotli 1.0.9 is latest version.

@miurahr
Copy link
Owner

miurahr commented Jul 26, 2023

There is a similar bug issue in brotli project.
google/brotli#782 (comment)

said

Maybe you're system is missing the visual c++ redistributable DLLs (though I think python itself should come with one).
You said 64-bit, try to install the current "vc_redist.x64.exe" from this link
https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads

@miurahr miurahr added the bug Something isn't working label Nov 6, 2023
@miurahr
Copy link
Owner

miurahr commented Nov 6, 2023

@yannou38 does #543 solve your issue?

@yannou38
Copy link
Author

yannou38 commented Nov 6, 2023

I'm sorry but i'm unable to reproduce the error. I had changed my CI to install brotlicffi manually so that the brotli failure would fall back on it, but uninstalling this module and trying again to install qt seem to works on the azure VM, and i'm not sure why (I don't have manual access to this VM, we may have installed the c++ redis for example) and i can't see if there's an error message.

However, i took a look at the PR and it seems good, so thanks for the work !

@yannou38 yannou38 closed this as completed Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants