I'm using anaconda, I've installed sqlite3 using the environments.
When I run my script in the IDE, creates and populates the db no problem.
When I run the script from C++, it ignores the sqlite3 parts giving no errors and no database is created or populated. I know the script does run when called from C++ because other parts of it still function, but it just ignores the SQLite aspect.
string command = "C:\\Anaconda3\\python.exe C:\\CoSim2\\PYTHON\\python\\MainMaster.py " + std::to_string(minute);
from pathlib import Path
conn = sqlite3.connect('CoSimTest.db')
c = conn.cursor()
c.execute('CREATE TABLE IF NOT EXISTS PowerSysInfo(time REAL, NumOfNodes INT, NumOfBuses INT, BusLocation TEXT, PhaseNumber INT, v1 REAL, a1 REAL, phase1 INT, v2 REAL, a2 REAL, phase2 INT, v3 REAL, a3 REAL, phase3 INT)')
So i thought i'd post the solution to my own question in case others have this problem.
conn = sqlite3.connect('CoSimTest.db') needs a full path as the local directory changes when not running it from the ide.