[issue27516] Wrong initialization of python path with embeddable distribution

Eryk Sun report at bugs.python.org
Thu Jul 14 21:33:49 EDT 2016


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 <report at bugs.python.org>
<http://bugs.python.org/issue27516>
_______________________________________


More information about the Python-bugs-list mailing list