Hey Brénainn, Thanks for taking a look at this issue. I did find that path of where it locates the flag and then where the error is raised but was unable to progress past that.
I will try and get them to run that command to see if there is anything else there. Separately, they did confirm that the same executable works on a different computer, but the error is surfacing on the more restricted Windows environment they would use in production. Here's a simple app per your request that just prints "hello" built in `--onedir` mode with the same build environment: https://drive.google.com/file/d/1523gS8W7bJIqApzAXk_4W9gRevwbfZs9/ Regards, Ryan On Thursday, November 5, 2020 at 7:12:33 AM UTC-8 bwoodsend wrote: > Hmm, gross. > > I can see exactly where in PyInstaller’s code this error is being raised. > Here > <https://github.com/pyinstaller/pyinstaller/blob/59883973838a09c9a55eceb2c4ba466d90786bd4/bootloader/src/pyi_python.c#L35> > > it tries to locate this Py_DontWriteBytecodeFlag configuration variable, > and following through to the definition of the DECLVAR() macro here > <https://github.com/pyinstaller/pyinstaller/blob/59883973838a09c9a55eceb2c4ba466d90786bd4/bootloader/src/pyi_python.h#L206-L213> > > you can see the error being raised. I notice the docs for the flag > <https://docs.python.org/3.8/c-api/init.html#c.Py_DontWriteBytecodeFlag> > disappears if you rewind back to Python 3.6 but that flag must still be > there or everyone would be experiencing issues with Python 3.6. And I can > confirm that it’s still present in my python36.dll using: > > import ctypes > print(ctypes.POINTER(ctypes.c_int).from_address(ctypes.addressof(ctypes.pythonapi.Py_DontWriteBytecodeFlag)).contents) > > which would raise an AttributeError if it didn’t exist (otherwise prints 1 > if running Python with the -B option). > > What I really don’t understand is why only this one user is seeing it. The > only thing I can think of is said user has another incompatible copy of > python36.dll in PATH which is being read instead. Could you ask them to > run where python* in the command prompt and tell you if there’s anything > else there? Could you also build a simple print("hello") app in --onedir > mode using your environment and upload it somewhere I can inspect it? > > Brénainn > -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/fb3ce9ef-867c-42d6-b182-236504f37610n%40googlegroups.com.
