You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the latest black binary on linux, the following error is thrown:
Traceback (most recent call last):
File "black/__main__.py", line 1, in <module>
File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
File "black/__init__.py", line 38, in <module>
File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
File "black/nodes.py", line 28, in <module>
File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
File "black/cache.py", line 9, in <module>
File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
File "platformdirs/__init__.py", line 31, in <module>
File "platformdirs/__init__.py", line 27, in _set_platform_dir_class
File "importlib/__init__.py", line 127, in import_module
ModuleNotFoundError: No module named 'platformdirs.unix'
[2725] Failed to execute script '__main__' due to unhandled exception!
This seems to an issue with PyInstaller missing a module during packaging.
To Reproduce
Run a linux container: docker run --rm -it debian:stable-slim bash
Download the black binary: wget --tries=5 -q -O /usr/local/bin/black https://github.com/psf/black/releases/download/21.8b0/black_linux && chmod +x /usr/local/bin/black
Run black: black -v
Expected behavior
The version of black should be printed.
Environment (please complete the following information):
This error doesn't occur when using the 21.7b0 binaries. platformdirs.unix may need to be added explicitly using PyInstaller's hidden imports functionality.
The text was updated successfully, but these errors were encountered:
Add new platformdirs dependencies as hidden imports when creating
PyInstaller-based binaries.
platformdirs imports the module for each platform dynamically, which
PyInstaller is unable to correctly detect for packing. By adding the
modules as hidden imports, we are telling PyInstaller to include the
modules in the packaged binary.
This issue seems to have been introduce when switching to platformdirs
in #2375. fixes#2464
Commit history before merge:
* Add hidden import to PyInstaller build
Add new platformdirs dependency as a hidden import when creating
PyInstaller based binaries.
* Only include the platformdirs for the relevant os
Describe the bug
When running the latest black binary on linux, the following error is thrown:
This seems to an issue with PyInstaller missing a module during packaging.
To Reproduce
docker run --rm -it debian:stable-slim bash
wget --tries=5 -q -O /usr/local/bin/black https://github.com/psf/black/releases/download/21.8b0/black_linux && chmod +x /usr/local/bin/black
black -v
Expected behavior
The version of
black
should be printed.Environment (please complete the following information):
Does this bug also happen on main?
N/A?
Additional context
This is likely due to #2375.
This error doesn't occur when using the 21.7b0 binaries.
platformdirs.unix
may need to be added explicitly using PyInstaller's hidden imports functionality.The text was updated successfully, but these errors were encountered: