On May 19, 7:10 pm, Giovanni Bajo <[email protected]> wrote:
>
> This looks like it can't be fixed. That import happens before *any*
> Python code is executed, within Py_Initialize(). I don't see *any* way
> to hook that import, unfortunately.
>
> It happens only under Linux because in that system the Python binary
> contains a hardcoded prefix (like /usr/lib) that is always tried (see
> getpath.c in Python's source code). The Win32 getpath module instead
> doesn't have any hardcoded path.
>
Although it looks wrong that we're picking up the host's version of
the encodings package rather than the one included with the
executable, that may not be the cause of the LookupError after all.
Just as a quick test, I modified launch.c to do a "del sys.modules
['encodings']" after making the sys.path changes. In my test script, I
explicitly imported encodings and encodings.utf_8 and printed out
their __file__ to see where they were coming from. When run, I see
that both encodings and encodings.utf_8 have been imported from
the .pyz file, as they should be, but the LookupError still happens.
Regards,
Vinay Sajip
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/PyInstaller?hl=en
-~----------~----~----~----~------~----~------~--~---