Check default configuration by
with open('python38._pth', 'r') as fin:
print(fin.read())
>>> with open('python38._pth', 'r') as fin:
... print(fin.read())
...
python38.zip
.
# Uncomment to run site.main() automatically
#import site
>>>
Uncomment to run site.main() automatically by
with open('python38._pth', 'r') as fin:
filetext=fin.read()
filetext=filetext.replace('#import site','import site')
with open('python38._pth', 'w') as fin:
fin.write(filetext)
>>> with open('python38._pth', 'r') as fin:
... filetext=fin.read()
...
>>> filetext=filetext.replace('#import site','import site')
>>> with open('python38._pth', 'w') as fin:
... fin.write(filetext)
...
73
>>>
Check configuration again
>>> with open('python38._pth', 'r') as fin:
... print(fin.read())
...
python38.zip
.
# Uncomment to run site.main() automatically
import site
>>>
Restart the Embedded Python and check sys.path of Embedded Python again
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
['D:\\python-3.8.1-embed-amd64\\python38.zip', 'D:\\python-3.8.1-embed-amd64', '
D:\\python-3.8.1-embed-amd64\\lib\\site-packages']
>>>