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
Preserve original PYTHONPATH in a different env-variable #1104
Comments
I'm afraid if we implement such a feature, people will use it and wonder why stuff is not working as expected. (Hmm, maybe we can use some ugly variable-name like As a work-around you could use a simple script (shell or .bat) preserving the original PYTHONPATH in a different variable. |
Hi, thanks for the fast answer and the wrapper idea. Johannes |
@matysek What do you think? I'm in favour of closing as "won't fix" |
I just noticed something goofy: PyInstaller sets the flag Py_IgnoreEnvironmentFlag, and then tries to use the PYTHONPATH environment to influence Python's initial sys.path. So our use of PYTHONPATH is a complete no-op. We only set PYTHONPATH before calling Py_Initialize, and only on Python 2. But for Python 2, we don't even need to set sys.path before initializing (only Python 3 cares about that because it needs the encodings module from our This makes the fix very trivial indeed. |
Fixed in 968311e PyInstaller no longer touches the PYTHONPATH environ. |
Hello,
I hope this wont be mistaken with #187 .
But it sort means to have a way to access the old PYTHONPATH.
Egg
when I run my binary PYTHONPATH is erased and set to "/tmp/__XXXXX" to have the binary run selve contained, which makes total sense.
Still as we are using this for an app to set environments, I sometimes would like to append sth to the PYTHONPATH that existed prior to launching the binary.
Would it be possible to save the old PYTHONPATH from the envirnment somewhere, so one can choose to reuse it afterwards ?
like stuff it into PYINSTALLER_PYTHONPATH_OLD, sure if the PYTHONPATH is emtpy this should not happen...
Or is this impossible to do by design ?
-johannes
The text was updated successfully, but these errors were encountered: