◐ Shell
clean mode source ↗

Message 354856 - Python tracker

Just in case this will be of help to anyone, I found a way to use venvs in embedded python.

- You first need to Initialize python that is referred as home in pyvenv.cfg.
- Then you execute the following script:

import sys
sys.executable = r"Path to the python executable inside the venv"
path = sys.path
for i in range(len(path)-1, -1, -1):
    if path[i].find("site-packages") > 0:
        path.pop(i)
import site
site.main()
del sys, path, i, site