Upstream removal of fake site
module breaks TensorFlow support
#529
Labels
bug
Something isn't working
site
module breaks TensorFlow support
#529
Describe the bug
PyInstaller's fake
site
module was recently removed, allowing the value ofsite.USER_SITE
to once again beNone
. This bug affects PyInstaller from 5.5 through 5.7This causes a problem with some introspection in TensorFlow that runs at import time which assumes this value will always be a string.
Users affected by this bug can either pin
PyInstaller<5.5
or work around the issue by executingimport site; site.USER_SITE = ''
before any TensorFlow imports occur (either in your application code or in a custom runtime hook), and the fix is probably to do something similar in a runtime hook for the library.To Reproduce
A minimal example file:
PyInstaller command:
Error (when running the resulting distribution):
Note that the line numbers reported here are on the far side of template interpolation during TensorFlow's build process,
tensorflow_core\__init__.py:769
in this error report corresponds to Line 130 of the templated fileExpected behavior
The test program should not error on the import and should print the success message, as it does in PyInstaller versions preceding 5.5
Screenshots
N/A
Desktop (please complete the following information):
pyinstaller-hooks-contrib
: 2022.14Additional context
N/A
The text was updated successfully, but these errors were encountered: