Skip to content

Pin pyinstaller-hooks-contrib to fix Requests v2.28.2 dependency - #59

Merged
MCMi460 merged 1 commit into
MCMi460:developmentfrom
HotaruBlaze:fix-build
Jan 15, 2023
Merged

MCMi460 merged 1 commit into
MCMi460:developmentfrom
HotaruBlaze:fix-build

Conversation

@HotaruBlaze

@HotaruBlaze HotaruBlaze commented Jan 12, 2023 •

Copy link
Copy Markdown
Contributor

Update: This has been fixed via: pyinstaller/pyinstaller-hooks-contrib#534 and was in fact an issue with PyInstaller, I've done the correct fix and replaced the commit.

Requests has released v2.28.2 that added support for charset_normalizer 3.x, However it seems to be causing build issues when the application is built and also trying to use chardet (An alternative to charset_normalizer), the application is meant to detect and decide what one to use, however failing with PyInstaller.

Forcing charset_normalizer to 2.x seems to fix the issue, however this may only be a temporary change.

Note: The environment that triggers this issue seems semi-random. However I was able to replicate it on a fresh windows vm, however not a fresh PIP & Python environment.

Traceback (most recent call last):
  File "requests\compat.py", line 11, in <module>
ModuleNotFoundError: No module named 'chardet'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "app.py", line 9, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
  File "requests\__init__.py", line 45, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
  File "requests\exceptions.py", line 9, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
  File "requests\compat.py", line 13, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
  File "charset_normalizer\__init__.py", line 24, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
  File "charset_normalizer\api.py", line 5, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
  File "charset_normalizer\cd.py", line 9, in <module>
ModuleNotFoundError: No module named 'charset_normalizer.md__mypyc'

QfMtulN8pHb2lZce

@HotaruBlaze HotaruBlaze changed the title Requests v2.28.2 seems to be breaking builds due to charset_normalizer 3.0 Requests v2.28.2 seems to be breaking builds due to charset_normalizer 3.x Jan 12, 2023
@HotaruBlaze HotaruBlaze changed the title Requests v2.28.2 seems to be breaking builds due to charset_normalizer 3.x Requests v2.28.2 breaking builds when using charset_normalizer 3.x Jan 12, 2023
@HotaruBlaze HotaruBlaze changed the title Requests v2.28.2 breaking builds when using charset_normalizer 3.x Pin pyinstaller-hooks-contrib to fix Requests v2.28.2 dependency Jan 15, 2023
@MCMi460

MCMi460 commented Jan 15, 2023

Copy link
Copy Markdown
Owner

Wow, this is interesting. Thank you so much for helping out and finding this! I don't know if I would've known about it otherwise.
I'll go ahead and merge this into development. Thank you again!

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 this pull request may close these issues.

2 participants