Eryk Sun added the comment: It looks like you haven't copied pyvenv.cfg to your application directory, so Python isn't using the "applocal" configuration. That's why you're seeing the default paths that are relative to the current directory. It's also why PYTHONPATH and PYTHONHOME aren't ignored.
As to the extension modules, if you don't want them in the application directory, add them to the DLLs subdirectory. Here's a possible layout: App\ DLLs\ _socket.pyd ... Lib\ vendored_package ... app.exe pyvenv.cfg python35.dll python35.zip vcruntime140.dll I created this app in C:\Temp, and here's its sys.path: ['C:\\Temp\\App\\python35.zip', 'C:\\Temp\\App\\DLLs', 'C:\\Temp\\App\\lib', 'C:\\Temp\\App'] ---------- nosy: +eryksun _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27516> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com