Message380780
> How do you configure sys.path currently? Do you parse a configuration file? Do you use a registry key on Windows?
We have several launch scenarios - but for the currently most common one, which is to launch using a separate, existing Python environment, we call Py_SetPythonHome and Py_SetPath with the home directory of the environment. Then, presumably, the more complete path gets set in either Py_Initialize or when we call PyImport_ImportModule(“sys”). I might have tracked the details down once, but I don't recall them. By the time our Python code starts running, sys.path is reasonably populated.
However, in another scenario, we launch with an embedded Python environment, essentially a virtual environment. In that case, we have a config file to explicitly add lib, DLLs, and site packages. But something goes wrong [cannot find/load the unicode DLL IIRC] unless we call site.addsitedir for each directory already in sys.path near the start of our Python portion of code. My notes point to two issues to explain this: https://bugs.python.org/issue22213 and https://bugs.python.org/issue35706. |
|
Date |
User |
Action |
Args |
2020-11-11 17:46:43 | cmeyer | set | recipients:
+ cmeyer, vstinner, shihai1991 |
2020-11-11 17:46:43 | cmeyer | set | messageid: <1605116803.53.0.805529342911.issue42260@roundup.psfhosted.org> |
2020-11-11 17:46:43 | cmeyer | link | issue42260 messages |
2020-11-11 17:46:43 | cmeyer | create | |
|