Python Embeddable Zip File Doesn't Include lib/site-packages in sys.path
After extracting the Python embeddable zip file, there is a file called
python36._pth
in the root directory. That file contains the following text:
# Uncomment to run site.main() automatically
#import site
As the comment indicates, simply uncomment the import site
statement by
removing the '#' character. After doing so, the sys.path
variable contains:
'...\\python36.zip'
'...'
'...\\\n'
'...\\lib\\site-packages'
This is still different than the installed version, but is exactly what I needed in my particular case.
BEGIN EDIT
I also discovered that you can remove the python36._pth
file entirely, which
reverts Python to behavior of the non-embeddable version.