C ++ cannot introduce the problem solution of the built-in module in calling the Python3 script.
C ++ cannot introduce the built-in module in the Python3 script to solve the problem. Recently I used tensorflow (the lazy version) to make some things. Due to python's performance, I used C ++ to collect data. Therefore, C ++ is required to call the python module. For the lazy version in windows, only 3.5 + can be used, otherwise there will be no such thing.
Problem: built-in modules cannot be introduced in the startup script.
Create
Create a simple File
By comparing whether numpy is introduced, we can find that it is indeed an error caused by the introduction of built-in modules.
Ps: PyErr_Print () in the qt environment; this function does not respond.
Cause: I guess the Python environment started from C ++ does not use environment variables when running the script (or does not scan the built-in modules at all), so the module path cannot be found. Solution: 1. Copy the built-in modules to the running directory.
2. import finds the built-in module through the absolute path
Note: from the test results, the module path cannot be found when the error is true.